public Pair<BlobId, DataNodeId> blobDelete503ReplicateBlobFailure(boolean enableOfflineRepair) throws Exception {
    String serviceID = "delete-service";
    MockServerLayout layout = new MockServerLayout(mockClusterMap);
    String localDcName = "DC3";
    setRouter(getNonBlockingRouterPropertiesForRepairRequests(localDcName, true, enableOfflineRepair, false), layout,
        new LoggingNotificationSystem());
    setOperationParams();
    String blobId = router.putBlob(putBlobProperties, putUserMetadata, putChannel, new PutBlobOptionsBuilder().build())
        .get(AWAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS);

    // set error status for all the replicas except one local replica
    DataNodeId sourceDataNode = null;
    List<ServerErrorCode> localServerErrors = new ArrayList<>();
    List<ServerErrorCode> remoteServerErrors = new ArrayList<>();
    localServerErrors.add(ServerErrorCode.ReplicaUnavailable); // return Replica_Unavailable for the first Delete
    localServerErrors.add(ServerErrorCode.UnknownError);  // return Unknown_Error for the ReplicateBlob Request
    remoteServerErrors.add(ServerErrorCode.BlobNotFound); // return NOT_FOUND for the first Delete Request
    remoteServerErrors.add(ServerErrorCode.UnknownError);  // return Unknown_Error for the ReplicateBlob Request
    for (MockServer server : layout.getMockServers()) {
      if (server.getDataCenter().equals(localDcName)) {
        // local DC, return NO_ERROR for one replica,
        if (sourceDataNode == null) {
          sourceDataNode = mockClusterMap.getDataNodeId(server.getHostName(), server.getHostPort());
        } else {
          server.setServerErrors(localServerErrors);
        }
      } else {
        server.setServerErrors(remoteServerErrors);
      }
    }

    // Delete should fail with Unavailable. The error status should come from the deletion, not from the ReplicateBlob.
    try {
      router.deleteBlob(blobId, serviceID).get();
      if (!enableOfflineRepair) {
        fail("Deletion should fail when offline repair is disabled.");
      }
    } catch (Exception e) {
      if (!enableOfflineRepair) {
        RouterException r = (RouterException) e.getCause();
        Assert.assertEquals(RouterErrorCode.AmbryUnavailable, r.getErrorCode());
      } else {
        fail("Should be successful when offline repair is enabled.");
      }
    } finally {
      layout.getMockServers().forEach(mockServer -> mockServer.setServerErrorForAllRequests(null));
      router.getNotFoundCache().invalidateAll();
      if (router != null) {
        router.close();
      }
    }
    return new Pair<>(RouterUtils.getBlobIdFromString(blobId, mockClusterMap), sourceDataNode);
  }
Deletion first hits 503. The following ReplicateBlob fails.
@param enableOfflineRepair if true, we inject the repair request to the db and return success status. if not, fail.
@return a pair of the blob id and source replica which returns the success status.
@throws Exception
ambry-router/src/test/java/com/github/ambry/router/NonBlockingRouterTest.java