[SERVER-52947] Tenant migration donor should attach TransientTransactionError when returning TenantMigrationCommitted or TenantMigrationAborted on a transaction operation Created: 19/Nov/20  Updated: 29/Oct/23  Resolved: 16/Dec/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.9.0-alpha0

Type: Task Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Andrew Shuvalov (Inactive)
Resolution: Fixed Votes: 0
Labels: pm-1791_milestone-H
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-12-14, Sharding 2020-12-28
Participants:

 Description   

Originally we planned for the donor to just return TenantMigrationCommitted or TenantMigrationAborted without any error label, and have the proxy convert this to NoSuchTransaction with TransientTransactionError.

However, max.hirschhorn pointed out that the donor could just attach TransientTransactionError itself, and there's no need to convert the error to NoSuchTransaction.

Note that transaction operations that could fail with TenantMigrationCommitted or TenantMigrationAborted are commitTransaction or read with readConcern snapshot or afterClusterTime, so we should test that TransientTransactionError is attached on both of these.



 Comments   
Comment by Githook User [ 16/Dec/20 ]

Author:

{'name': 'Andrew Shuvalov', 'email': 'andrew.shuvalov@mongodb.com', 'username': 'shuvalov-mdb'}

Message: SERVER-52947: Tenant migration donor should attach TransientTransactionError when returning TenantMigrationCommitted or TenantMigrationAborted on a transaction operation
Branch: master
https://github.com/mongodb/mongo/commit/d5743ba8411a50534d33bc2e940377fb003dccea

Comment by Andrew Shuvalov (Inactive) [ 08/Dec/20 ]

As cheahuychou.mao explained, TransientTransactionError helps the caller doing a transaction or a read with particular read concerns to know that it is safe and correct to retry the entire transaction or read. To fix that, we add support of `case TennatMigrationAborted:` and `case TenantMigrationCommitted:` to this switch statement. The test to modify is `tenant_migration_concurrent_writes.js`. 

Generated at Thu Feb 08 05:29:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.