[SERVER-80913] Wtimeout parameter in writeConcern not being honored during sharded transactions Created: 08/Sep/23  Updated: 12/Dec/23

Status: Needs Scheduling
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Vishnu Kaushik Assignee: Backlog - Cluster Scalability
Resolution: Unresolved Votes: 0
Labels: sharding-product-sync
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Cluster Scalability
Operating System: ALL
Participants:

 Description   

session.startTransaction({writeConcern: {w: 'majority', wtimeout: 5000}});
sessionColl.insert({_id: 1});
session.commitTransaction({writeConcern: {w: 'majority', wtimeout: 3000}});

When running this through mongo shell on mongos, I don't see wtimeout showing up when I turn on high COMMAND verbosity on mongod on prepareTransaction and commitTransaction.

So if we kill two nodes in a 3 node shard, then we will observe that the prepareTransaction / commitTransaction blocks indefinitely, since that is the default value of wtimeout.

This is not the case if I run the above statements on a replica set (although the value of wtimeout used when committing is from startTransaction).

Wtimeout is honored when running individual operations on a sharded cluster. For example, I see that a single insert operation with a w and wtimeout value has the writeConcern values respected.


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