[SERVER-31912] waitUntilDurable() should use its own WT_SESSION, not one from the cache Created: 10/Nov/17  Updated: 30/Oct/23  Resolved: 13/Nov/17

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.6.0-rc4

Type: Improvement Priority: Major - P3
Reporter: Eric Milkie Assignee: Eric Milkie
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-31694 17% throughput regression in insert w... Closed
Backwards Compatibility: Fully Compatible
Sprint: Storage 2017-11-13
Participants:

 Description   

waitUntilDurable() only needs a session to call log_flush() and checkpoint(). Since it uses no cursors, it should be fine to have it simply use one long-lived session object for this, rather than getting a session out of the cache every time.
The benefit for this will be to reduce contention on the mutex that protects the session cache, as it must be locked every time a session is taken out of the cache and every time a session is returned to the cache.



 Comments   
Comment by Githook User [ 13/Nov/17 ]

Author:

{'name': 'Eric Milkie', 'username': 'milkie', 'email': 'milkie@10gen.com'}

Message: SERVER-31912 use a private WT_SESSION in waitUntilDurable instead of one from the session cache
Branch: master
https://github.com/mongodb/mongo/commit/9a1f209aa8e47587af6ad81e991b101abea1f677

Comment by Eric Milkie [ 10/Nov/17 ]

Ah I see, there is another code path in that function that uses a session and is not mutex protected. However, I'm not interested in optimizing that codepath, so it will continue to use a cached session for its work.

Comment by Eric Milkie [ 10/Nov/17 ]

They do, but the place where the function makes calls on the session is mutex protected, and threads that block on the mutex are short-circuited when they finally acquire it.

Comment by Andy Schwerin [ 10/Nov/17 ]

Do you mean one session used by all the threads that simultaneously call waitForDurable? A bunch of threads call that, right?

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