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

Failure to start an internal cross-shard transaction from a shardsvr mongod on behalf of a client that is already running a transaction

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc10, 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v6.0
    • Sharding NYC 2022-05-30, Sharding NYC 2022-06-13

      The transaction API supports running an internal cross-shard transaction from a shardsvr mongod on behalf of a client regardless of the session configuration it is running with (i.e. the mongod acts a router). However, currently it is unable to do so if the client is running a transaction. The reason is that when starting a cross-shard transaction from a shardsvr mongod, the transaction API sends all the commands in the transaction through the ServiceEntryPointMongos (i.e. the transaction is driven by the TransactionRouter for the client session on that mongod); the API currently always sends the first command in the transaction without startTransaction and this causes the transaction to fail with NoSuchTransaction since the TransactionRouter is unaware of any ongoing transaction with that session id and transaction number (only the TransactionParticipant is). Making the API send the first command with startTransaction=true would allow the TransactionRouter on the mongod to successfully initialize the transaction. However, if the shard acting as a router for internal transaction also participates in the transaction, the first command to that shard would fail with ConflictingOperationInProgress since the TransactionRouter would send that command with startTransaction=true since it is unaware that the transaction has already started on that shard. 

            Assignee:
            jason.zhang@mongodb.com Jason Zhang
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: