[SERVER-65299] Not reset RetryableWriteTransactionParticipantCatalog upon starting an internal transaction for non-retryable write Created: 06/Apr/22  Updated: 29/Oct/23  Resolved: 07/Apr/22

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

Type: Bug Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding NYC 2022-04-18
Participants:

 Description   

Resetting the RetryableWriteTransactionParticipantCatalog upon starting an internal transaction for a non-retryable write leads to an invariant failure in the following case.

Consider a sharded collection with two chunks: chunk0 and chunk1, which reside on shard0 and shard1, respectively.

  1. The client starts a retryableWrite=false session S and performs a write against chunk0 in a transaction T0 with txnNumber0.
  2. chunk0 is moved from shard0 to shard1. During the migration, shard1 writes a dead-end sentinel noop oplog entry for T0.
  3. chunk0 is moved from shard1 back to shard0.
  4. The client performs a write against chunk1 in the session S outside a transaction. The write needs to executed using a transaction so the router executes it in an internal transaction for non-retryable write T1. Upon starting T1, shard1 resets/invalidates the RetryableWriteTransactionParticipantCatalog for S.
  5. chunk0 is moved from shard0 to shard1 again. During the migration, shard1 hits this invariant when processing the dead-end sentinel noop oplog entry for T0. Note that beginOrContinue() does not fail on shard1 with InCompleteTransactionHistory because from the perspective of shard1, txnNumber0 has always corresponded to a retryable write because of the dead-end sentinel oplog entry it wrote in step 2.


 Comments   
Comment by Githook User [ 07/Apr/22 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-65299 Not reset RetryableWriteTransactionParticipantCatalog upon starting an internal transaction for non-retryable write
Branch: master
https://github.com/mongodb/mongo/commit/f4398987e7222d2e55fec776bc7a2e3c44af42cf

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