ShardRemote::runAggregation should only return postBatchResumeToken when the batch is empty

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Cluster Scalability
    • ALL
    • ClusterScalability Jun9-Jun23
    • 200
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-106349 made ShardRemote::runAggregation return postBatchResumeToken even when the batch is not empty so that 'reshardProgressMark' oplog entries get inserted even when the cursor hasn't reached the end of the oplog or is still finding matching oplog entries. However, it is incorrect to consult the postBatchResumeToken when the batch is non-empty because by design the postBatchResumeToken is the highest _id seen in the collection scan. The document with that _id may or may not be part of the batch itself.

      1. It could be that the document got filtered out from the batch due to $match.
      2. It could be that the document just hasn't been included yet in the batch due to the response size limit.  

      Given this, we should revert the changes to ShardRemote::runAggregation and update the ReshardingOplogFetcher unit tests accordingly. 

            Assignee:
            Cheahuychou Mao
            Reporter:
            Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: