protected void addPartitionToReplicaThread(PartitionId partitionId, List<RemoteReplicaInfo> remoteReplicaInfos) {
    /**
     * This fn must be called with rwlock.writeLock() held.
     * It is called by helix when a new partition (not a new replica) is assigned to VCR node.
     * addPartition -> addPartitionToReplicaThread
     */
    // All replicas belong to the same partition, so just assign all to the same thread
    ReplicaThread rthread = threadPool.get(threadIndex.incrementAndGet() % threadPool.size());
    for (RemoteReplicaInfo rinfo : remoteReplicaInfos) {
      String datacenter = rinfo.getReplicaId().getDataNodeId().getDatacenterName();
      if (!localDatacenterName.equalsIgnoreCase(datacenter)) {
        throw new UnsupportedOperationException(
            String.format("Cross-colo replication from %s to %s is unsupported in VCR for replica {}",
                localDatacenterName, datacenter, rinfo));
      }
      rthread.addRemoteReplicaInfo(rinfo);
      rinfo.setReplicaThread(rthread);
      logger.info("[PARTITION] Added replica {} to thread {}", rinfo, rthread.getName());
    }
    partitionToPartitionInfo.get(partitionId).setReplicaThread(rthread);
    rthread.startThread();
  }
Assign all replicas of a partition to the same thread to avoid concurrent updates to Azure

@param partitionId Partition
@param remoteReplicaInfos List of {@link RemoteReplicaInfo} List of replicas, must belong to same partition
ambry-cloud/src/main/java/com/github/ambry/cloud/VcrReplicationManager.java