public Pair<BlobId, DataNodeId> blobDelete503ReplicateBlobSuccessRetryFailure(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> serverErrors = new ArrayList<>();
    serverErrors.add(ServerErrorCode.BlobNotFound);       // for the first Delete request
    serverErrors.add(ServerErrorCode.NoError);             // for the ReplicateBlob request
    serverErrors.add(ServerErrorCode.ReplicaUnavailable);  // for the Delete retry
    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(serverErrors);
        }
      } else {
        server.setServerErrorForAllRequests(ServerErrorCode.ReplicaUnavailable);
      }
    }

    // ReplicateBlob is successful on the other two local replicas but retry fail with unavailable.
    try {
      router.deleteBlob(blobId, serviceID).get();
      if (!enableOfflineRepair) {
        fail("Deletion should fail if offline repair is disabled. ");
      }
    } catch (Exception e) {
      if (!enableOfflineRepair) {
        RouterException r = (RouterException) e.getCause();
        Assert.assertEquals("BlobDeleted error is expected", RouterErrorCode.AmbryUnavailable, r.getErrorCode());
      } else {
        fail("Deletion should succeed if 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);
  }
Test Deletion first hits 503. The following ReplicateBlob is successful but retry fails.
Test the cases that enable offline repair is enabled or disabled.
@param enableOfflineRepair enable the offline repair
@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