@Test
  public void testCompositeBlobTtlUpdate503AndThenRetrySuccess() throws Exception {
    try {
      // CompositeBlob with four chunks.
      maxPutChunkSize = PUT_CONTENT_SIZE / 4;
      String updateServiceId = "update-service";
      MockServerLayout layout = new MockServerLayout(mockClusterMap);
      setRouter(getNonBlockingRouterPropertiesForRepairRequests(localDcName, true, false, false), layout,
          new LoggingNotificationSystem());
      setOperationParams();
      String compositeBlobId =
          router.putBlob(putBlobProperties, putUserMetadata, putChannel, new PutBlobOptionsBuilder().build())
              .get(AWAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS);
      assertTtl(router, Collections.singleton(compositeBlobId), TimeUnit.DAYS.toSeconds(7));

      // set two replicas Replica_Unavailable. Leave one local replica available as the source of the ReplicationBlob
      DataNodeId sourceDataNode = null;
      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.setServerErrorForAllRequests(ServerErrorCode.ReplicaUnavailable);
          }
        }
      }
      router.updateBlobTtl(compositeBlobId, updateServiceId, Utils.Infinite_Time).get();

      // simulate Replica_Unavailable for all local replicas. Then verify ttl from the remote replica
      for (MockServer server : layout.getMockServers()) {
        if (server.getDataCenter().equals(localDcName)) {
          server.setServerErrorForAllRequests(ServerErrorCode.ReplicaUnavailable);
        }
      }
      assertTtl(router, Collections.singleton(compositeBlobId), Utils.Infinite_Time);

      layout.getMockServers().forEach(mockServer -> mockServer.setServerErrorForAllRequests(null));
    } finally {
      // Since we are using same blob ID for all tests, clear cache which stores blobs that are not found in router.
      router.getNotFoundCache().invalidateAll();

      if (router != null) {
        router.close();
      }
    }
  }
CompositeBlob TTLUpdate first hits 503. Then run ReplicateBlob and Retry. It is successful.
@throws Exception
ambry-router/src/test/java/com/github/ambry/router/NonBlockingRouterTest.java