[SERVER-40069] GlobalLockAcquisitionTracker::getGlobalWriteLocked should return true if the OperationContext it decorates ever held a global write lock Created: 11/Mar/19  Updated: 29/Oct/23  Resolved: 17/Apr/19

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.1.11

Type: Task Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Judah Schvimer
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-39991 Add transactions workloads to failove... Closed
Related
is related to SERVER-40084 Prevent readers from reading garbage/... Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2019-04-22
Participants:
Linked BF Score: 23

 Description   

This would ensure two things that are not true today:

1) A command that unstashed locks held by a transaction waits for writeConcern of the system last OpTime. Today, because the locks are stashed before waiting for writeConcern, the command may end up waiting for an OpTime in a previous term.

2) Stepdown will kill a command that is waiting for writeConcern after having unstashed and stashed a transaction's locks. The command may be waiting for writeConcern even though it did not do a write, because its Client's last OpTime was set to the system last OpTime.



 Comments   
Comment by Githook User [ 17/Apr/19 ]

Author:

{'name': 'Judah Schvimer', 'username': 'judahschvimer', 'email': 'judah@mongodb.com'}

Message: SERVER-40069 Fix global lock tracking for txns

Includes SERVER-40084, stores global lock acquisition flag in an
atomic.
Branch: master
https://github.com/mongodb/mongo/commit/7a9f240519c55cc6af45e4783bfd54d81a79d1e0

Comment by Githook User [ 29/Mar/19 ]

Author:

{'email': 'benety@mongodb.com', 'name': 'Benety Goh', 'username': 'benety'}

Message: Revert "SERVER-40069 Fix global lock tracking for txns"

This reverts commit d99db775dbf73e27bd20e402f26f068dc199203d.
Branch: master
https://github.com/mongodb/mongo/commit/46d303c2de5529d3158f1fe0afc5bbeef6444dac

Comment by Githook User [ 28/Mar/19 ]

Author:

{'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}

Message: SERVER-40069 Fix global lock tracking for txns

Includes SERVER-40084, stores global lock acquisition flags in an
atomic.
Branch: master
https://github.com/mongodb/mongo/commit/d99db775dbf73e27bd20e402f26f068dc199203d

Comment by Siyuan Zhou [ 11/Mar/19 ]

To give more context, the first point esha.maharishi mentioned is the problem here. The fundamental problem is with locker stash / unstash, GlobalLockAcquisitionTracker doesn't accurately indicate whether this operation context could have done any writes. Imagine the first opCtx does a write and stashes a WUOW, then the second opCtx commits a WUOW but doesn't write oplog entries or anything else, GlobalLockAcquisitionTracker for the second opCtx will be wrong.

Generated at Thu Feb 08 04:53:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.