Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-63878

Make resharding aggregation pipeline emit applyOps documents for committed transactions before doing findAndModify image lookup

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0-rc3
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Sharding 2022-03-07

      Having the DocumentSourceReshardingIterateTransaction stage after DocumentSourceFindAndModifyImageLookup stage makes the resharding pipeline unable to forge a pre/post image oplog entry for a non terminal applyOps oplog entry. We should reorder the stages as follows:

      1. [DocumentSourceReshardingIterateTransaction] For committed transactions, emit the applyOps prevOpTime chain in ascending opTime order.
      2. [DocumentSourceFindAndModifyImageLookup] For a needsRetryImage CRUD or applyOps oplog entry, emit an op=n and modify the subsequent the oplog entry to say pre/postImageOpTime
      3.  [DocumentReshardingAddId] Fill in an _id so already-seen oplog entries can be ignored.

      Right now the _id adding is done as part of the DocumentSourceReshardingIterateTransaction stage since it is only stage that tracks the transaction commit timestamp. Therefore, for this ordering to work, we need to store the commit timestamp in each applyOps document emitted in the DocumentSourceReshardingIterateTransaction stage and in its forged pre/post image document in the DocumentSourceFindAndModifyImageLookup stage (if any) similar to how was done here.

       

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: