[SERVER-64415] Make MigrationChunkClonerSourceLegacy not add pre/post image opTime to the session migration queue Created: 10/Mar/22  Updated: 29/Oct/23  Resolved: 16/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0-rc4

Type: Task Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-63494 Transfer history for retryable transa... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding NYC 2022-03-21
Participants:

 Description   

For a retryable findAndModify statement that executes during a chunk migration, retryability is handled as follows.

For a retryable findAndModify statement that executes prior to a chunk migration, retryablity is handled quite differently in that _fetchNextOplogFromSessionCatalog() is responsible for both fetching and forging the pre/post image oplog entry for the write.

While this setup in _fetchNextNewWriteOplog() works for a regular retryable findAndModify, it will not work for a retryable findAndModify executed inside an internal transaction. Upon prepare or unprepared commit, the MigrationChunkClonerSourceLegacy could add the pre/post image opTime that it sees to session migration before adding the prepare or commit opTime to queue, however there is not a way for way to specify which statement the pre/post image opTime corresponds to. Since the SessionCatalogMigrationSource needs to traverse the transaction oplog chain anyway (in SERVER-63494), it is simpler for it to fetch the pre/post image oplog entry in _fetchNextNewWriteOplog() just like it does in _fetchNextOplogFromSessionCatalog(). Therefore, to avoid having separate logic for handling retryable findAndModify that executes inside and outside a transaction, we should do the following:

  • Make the MigrationChunkClonerSourceLegacy not add pre/post image opTime to the session migration queue
  • Make _fetchNextNewWriteOplog() use fetchPrePostImageOplog() to fetch or forge pre/post image oplog entry for each new write oplog entry here (i.e. remove this duplicated block of code), just like what _fetchNextOplogFromSessionCatalog() does.


 Comments   
Comment by Githook User [ 16/Mar/22 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-64415 Make MigrationChunkClonerSourceLegacy not add pre/post image opTime to the session migration queue
Branch: master
https://github.com/mongodb/mongo/commit/6da8828226321ef96eb05c79f3899b759844e02b

Generated at Thu Feb 08 06:00:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.