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

Consider making SplitPrepareSessionManager use internal sessions with session id (id, uid, txnUUID) to apply oplog entries for non-retryable internal transactions

    • Sharding NYC
    • ALL

      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.

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

              Created:
              Updated:
              Resolved: