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

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

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 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

      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@mongodb.com Erin Liang
            Reporter:
            israel.hsu@mongodb.com Israel Hsu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: