[SERVER-77187] Consider making SplitPrepareSessionManager use internal sessions with session id (id, uid, txnUUID) to apply oplog entries for non-retryable internal transactions Created: 16/May/23  Updated: 07/Jul/23  Resolved: 07/Jul/23

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

Type: Bug Priority: Minor - P4
Reporter: Cheahuychou Mao Assignee: Cheahuychou Mao
Resolution: Won't Do Votes: 0
Labels: intern-friendly, sharding-nyc-subteam3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-76807 The split prepared transaction mechan... Closed
Assigned Teams:
Sharding NYC
Operating System: ALL
Participants:

 Description   

To speed up transaction oplog application, PM-3093 made secondaries apply the oplog entries for each prepared transaction in multiple internal sessions acquired from the InternalSessionPool. Currently, those internal sessions always have session id of the form (id, uid) regardless of session id for the transaction. For a transaction with session id of the form (id, uid, txnUUID), i.e. non-retryable internal transaction, this has caused the oplog entries for the transaction to show up in the chunk migration opTime buffer although the writes they correspond to are not retryable and therefore are discarded anyway. SERVER-76807 solved this by making OpObserver::onTransactionPrepareNonPrimary() additionally take in the transaction's session id and use that instead of the session id from the opCtx to initialize LogTransactionOperationsForShardingHandler. While this solved the issue, there may be some values in making secondaries use internal sessions with session id of the form (id, uid, txnUUID) instead since it preserves the fact the transaction is not retryable. However, the approach has some dependencies since:

  • The InternalSessionPool doesn't currently support pooling sessions with session id for the form (id, uid, txnUUID) without specifying a parent.
  • The SessionCatalog doesn't support reaping a session with session id for the form (id, uid, txnUUID) until its parent session is expired.

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