@Test
  public void testCompositeBlobTtlUpdate503AndThenRetryFailure() 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
      // But all remote replicas fail the ReplicateBlob.
      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);
          }
        } else {
          server.setServerErrorForAllRequests(ServerErrorCode.BlobNotFound);
        }
      }
      try {
        router.updateBlobTtl(compositeBlobId, updateServiceId, Utils.Infinite_Time).get();
      } catch (Exception e) {
        assertTrue(e.getCause() instanceof RouterException);
        assertEquals(RouterErrorCode.AmbryUnavailable, ((RouterException) e.getCause()).getErrorCode());
      }
      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.
ReplicateBlob fails and then TtlUpdate fails.
@throws Exception
ambry-router/src/test/java/com/github/ambry/router/NonBlockingRouterTest.java