[SERVER-80432] waitForSession can miss JournalListener onDurable calls Created: 25/Aug/23  Updated: 29/Oct/23  Resolved: 06/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Matthew Russotto Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-80670 call JournalListener::onDurable outsi... Closed
related to SERVER-80657 clean up JournalListener access in Wi... Closed
is related to SERVER-20176 Deletes with j:true slower on WT than... Closed
is related to SERVER-48144 waitUntilDurable should not take a mu... Closed
is related to SERVER-46067 Internal code interface changes for R... Closed
is related to SERVER-46334 Eliminate the mutex held across Journ... Closed
Assigned Teams:
Storage Execution NAMER
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution NAMR Team 2023-09-04, Execution NAMR Team 2023-09-18
Participants:

 Description   

Suppose two threads have reached this point in waitForDurable:

https://github.com/10gen/mongo/blob/05d6797149cdae13a26693371ccd7b5b8e4aaadd/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp#L332

Each has obtained a journal token, one of which is older than the other. If the thread with the older token proceeds first, the thread with the newer token will exit here:

https://github.com/10gen/mongo/blob/05d6797149cdae13a26693371ccd7b5b8e4aaadd/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp#L340

without having called onDurable on the newer token, resulting in the newer token not being marked durable (though it is). I think this can be fixed by calling onDurable in the early exit path.

This was discovered during code inspection.



 Comments   
Comment by Githook User [ 01/Sep/23 ]

Author:

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

Message: SERVER-80432 mark JournalListener token as durable in early exit path in WiredTigerSessionCache::waitUntilDurable()
Branch: master
https://github.com/mongodb/mongo/commit/27dd6b9634dae282c81c0b1d35f70e6daab80b91

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