private void doAttachReplicateRegionReplicaAction(WALKeyImpl walKey, WALEdit walEdit,
    WriteEntry writeEntry) {
    if (walEdit == null || walEdit.isEmpty()) {
      return;
    }
    final ServerCall<?> rpcCall = RpcServer.getCurrentServerCallWithCellScanner().orElse(null);
    regionReplicationSink.ifPresent(sink -> writeEntry.attachCompletionAction(() -> {
      sink.add(walKey, walEdit, rpcCall);
    }));
  }
Attach {@link RegionReplicationSink#add} to the mvcc writeEntry for replicating to region
replica.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java