Restrict adding a participant in retryable statement in a retryable internal txn

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Cluster Scalability
    • Fully Compatible
    • Cluster Scalability 2024-2-19, Cluster Scalability 2024-3-4, Cluster Scalability 2024-3-18
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Prevent existing participant from adding a participant while executing a retryable statement in a retryable internal txn: In this case, TransactionRouter will call uassert() with ErrorCodes::IllegalOperation.

      TransactionRouter::Router::attachTxnFieldsIfNeeded() is where a router adds a new participant. This code is common to routers on mongos and on shards (mongod); thus we should only prevent the creation of a new participant when the opCtx indicates that the caller is an active transaction participant and that it is in a transaction: opCtx->isActiveTransactionParticipant() && opCtx->inMultiDocumentTransaction(). Additionally, opCtx->isRetryableWrite() indicates whether the current context is a retryable write.

              Assignee:
              Erin Liang
              Reporter:
              Israel Hsu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: