[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: |
|
||||||||||||||||
| 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: Includes |
| Comment by Githook User [ 29/Mar/19 ] |
|
Author: {'email': 'benety@mongodb.com', 'name': 'Benety Goh', 'username': 'benety'}Message: Revert " This reverts commit d99db775dbf73e27bd20e402f26f068dc199203d. |
| Comment by Githook User [ 28/Mar/19 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message: Includes |
| 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. |