@@ -1082,22 +1082,25 @@ func (verifier *Verifier) verifyMetadataAndPartitionCollection(ctx context.Conte
10821082 task .Status = verificationTaskMetadataMismatch
10831083 }
10841084
1085- partitions , shardKeys , docsCount , bytesCount , err := verifier .partitionAndInspectNamespace (ctx , srcNs )
1086- if err != nil {
1087- task .Status = verificationTaskFailed
1088- verifier .logger .Error ().Msgf ("[Worker %d] Error partitioning collection: %+v" , workerNum , err )
1089- return
1090- }
1091- verifier .logger .Debug ().Msgf ("[Worker %d] split collection “%s” into %d partitions" , workerNum , srcNs , len (partitions ))
1092-
1093- task .SourceDocumentCount = docsCount
1094- task .SourceByteCount = bytesCount
1095-
1096- for _ , partition := range partitions {
1097- _ , err := verifier .InsertPartitionVerificationTask (partition , shardKeys , dstNs )
1085+ if task .Generation == 0 {
1086+ partitions , shardKeys , docsCount , bytesCount , err := verifier .partitionAndInspectNamespace (ctx , srcNs )
10981087 if err != nil {
10991088 task .Status = verificationTaskFailed
1100- verifier .logger .Error ().Msgf ("[Worker %d] Error inserting verifier tasks: %+v" , workerNum , err )
1089+
1090+ verifier .logger .Error ().Msgf ("[Worker %d] Error partitioning collection: %+v" , workerNum , err )
1091+ return
1092+ }
1093+ verifier .logger .Debug ().Msgf ("[Worker %d] split collection “%s” into %d partitions" , workerNum , srcNs , len (partitions ))
1094+
1095+ task .SourceDocumentCount = docsCount
1096+ task .SourceByteCount = bytesCount
1097+
1098+ for _ , partition := range partitions {
1099+ _ , err := verifier .InsertPartitionVerificationTask (partition , shardKeys , dstNs )
1100+ if err != nil {
1101+ task .Status = verificationTaskFailed
1102+ verifier .logger .Error ().Msgf ("[Worker %d] Error inserting verifier tasks: %+v" , workerNum , err )
1103+ }
11011104 }
11021105 }
11031106
0 commit comments