private void commitSource ( ) { int partitionId = getPartitionId ( ) ; InternalPartitionServiceImpl partitionService = getService ( ) ; PartitionReplicaManager replicaManager = partitionService . getReplicaManager ( ) ; ILogger logger = getLogger ( ) ; int sourceNewReplicaIndex = migrationInfo . getSourceNewReplicaIndex ( ) ; if ( sourceNewReplicaIndex < 0 ) { clearPartitionReplicaVersions ( partitionId ) ; if ( logger . isFinestEnabled ( ) ) { logger . finest ( "Replica versions are cleared in source after migration. partitionId=" + partitionId ) ; } } else if ( migrationInfo . getSourceCurrentReplicaIndex ( ) != sourceNewReplicaIndex && sourceNewReplicaIndex > 1 ) { for ( ServiceNamespace namespace : replicaManager . getNamespaces ( partitionId ) ) { long [ ] versions = updatePartitionReplicaVersions ( replicaManager , partitionId , namespace , sourceNewReplicaIndex - 1 ) ; if ( logger . isFinestEnabled ( ) ) { logger . finest ( "Replica versions are set after SHIFT DOWN migration. partitionId=" + partitionId + " namespace: " + namespace + " replica versions=" + Arrays . toString ( versions ) ) ; } } } }
Updates the replica versions on the migration source if the replica index has changed .