private void checkReservedPartitionState() {
      if (reservedMetadataChunkId == null) {
        reservedMetadataIdMetrics.metadataIdNotReservedCount.inc();
        return;
      }
      PartitionId reservedPartitionId = reservedMetadataChunkId.getPartition();
      if (reservedPartitionId.getPartitionState() == PartitionState.READ_ONLY) {
        reservedMetadataIdMetrics.numReservedPartitionFoundReadOnlyCount.inc();
      }
      if (!clusterMap.hasEnoughEligibleReplicasAvailableForPut(reservedPartitionId, routerConfig.routerPutSuccessTarget,
          true)) {
        reservedMetadataIdMetrics.numReservedPartitionFoundUnavailableInLocalDcCount.inc();
      }
      if (!clusterMap.hasEnoughEligibleReplicasAvailableForPut(reservedPartitionId, routerConfig.routerPutSuccessTarget,
          false)) {
        reservedMetadataIdMetrics.numReservedPartitionFoundUnavailableInAllDcCount.inc();
      }
    }
Check if the partition of the reserved metadata chunk is available to take write.
ambry-router/src/main/java/com/github/ambry/router/PutOperation.java