Source:
void clearShadowTables() { CorfuStoreMetadata.Timestamp timestamp = logReplicationMetadataManager.getTimestamp(); long persistSiteConfigID = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.TOPOLOGY_CONFIG_ID); long persistSnapStart = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_STARTED); long persistSnapTransferred = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_TRANSFERRED); long persitSeqNum = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_SEQ_NUM); if (topologyConfigID != persistSiteConfigID || srcGlobalSnapshot != persistSnapStart || srcGlobalSnapshot <= persistSnapTransferred || persitSeqNum != Address.NON_ADDRESS) { log.warn("Skip current processing as the persistent metadata shows the current operation is out of date " + "current topologyConfigID srcGlobalSnapshot {}", logReplicationMetadataManager, topologyConfigID, srcGlobalSnapshot); return; } TxBuilder txBuilder = logReplicationMetadataManager.getTxBuilder(); logReplicationMetadataManager.appendUpdate(txBuilder, LogReplicationMetadataManager.LogReplicationMetadataType.TOPOLOGY_CONFIG_ID, topologyConfigID); for (UUID streamID : streamViewMap.keySet()) { UUID usedStreamID = uuidMap.get(streamID); SMREntry entry = new SMREntry("clear", new Array[0], Serializers.PRIMITIVE); txBuilder.logUpdate(usedStreamID, entry); } txBuilder.commit(timestamp); }

Target:
void clearShadowTables() { CorfuStoreMetadata.Timestamp timestamp = logReplicationMetadataManager.getTimestamp(); long persistTopologyConfigID = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.TOPOLOGY_CONFIG_ID); long persistSnapStart = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_STARTED); long persistSnapTransferred = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_TRANSFERRED); long persitSeqNum = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_SEQ_NUM); if (topologyConfigID != persistTopologyConfigID || srcGlobalSnapshot != persistSnapStart || srcGlobalSnapshot <= persistSnapTransferred || persitSeqNum != Address.NON_ADDRESS) { log.warn("Skip current processing as the persistent metadata shows the current operation is out of date " + "current topologyConfigID srcGlobalSnapshot {}", logReplicationMetadataManager, topologyConfigID, srcGlobalSnapshot); return; } TxBuilder txBuilder = logReplicationMetadataManager.getTxBuilder(); logReplicationMetadataManager.appendUpdate(txBuilder, LogReplicationMetadataManager.LogReplicationMetadataType.TOPOLOGY_CONFIG_ID, topologyConfigID); for (UUID streamID : streamViewMap.keySet()) { UUID usedStreamID = uuidMap.get(streamID); SMREntry entry = new SMREntry("clear", new Array[0], Serializers.PRIMITIVE); txBuilder.logUpdate(usedStreamID, entry); } txBuilder.commit(timestamp); }