[SERVER-40084] Prevent readers from reading garbage/stale value from global_lock_acquisition_tracker. Created: 12/Mar/19  Updated: 29/Oct/23  Resolved: 28/Mar/19

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

Type: Bug Priority: Major - P3
Reporter: Suganthi Mani Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-40069 GlobalLockAcquisitionTracker::getGlob... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2019-04-08
Participants:

 Description   

Currently, when we modify GlobalLockAcquisitionTracker:_globalLockMode, there is a possibility that the step down thread is reading its value concurrently. In order to avoid the step down thread from reading a garbage/stale value, make GlobalLockAcquisitionTracker:_globalLockMode as an AtomicWord<unsigned char>.



 Comments   
Comment by Judah Schvimer [ 17/Apr/19 ]

Between the above commits there was this revert:
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 [ 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 [ 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

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