New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce multi-threaded/multi-version client support for GRV caching #6664
Introduce multi-threaded/multi-version client support for GRV caching #6664
Conversation
Doxense CI Report for Windows 10
|
AWS CodeBuild CI Report for Linux CentOS 7
|
AWS CodeBuild CI Report for Linux CentOS 7
|
AWS CodeBuild CI Report for Linux CentOS 7
|
Doxense CI Report for Windows 10
|
AWS CodeBuild CI Report for Linux CentOS 7
|
AWS CodeBuild CI Report for macOS BigSur 11.5.2
|
Doxense CI Report for Windows 10
|
AWS CodeBuild CI Report for Linux CentOS 7
|
…ocolVersion instead of piping version through function parameters
…he-multi-threaded
AWS CodeBuild CI Report for Linux CentOS 7
|
Doxense CI Report for Windows 10
|
…from a null value
Doxense CI Report for Windows 10
|
AWS CodeBuild CI Report for macOS BigSur 11.5.2
|
AWS CodeBuild CI Report for Linux CentOS 7
|
@@ -233,10 +252,18 @@ void DatabaseContext::updateCachedReadVersion(double t, Version v) { | |||
} | |||
|
|||
Version DatabaseContext::getCachedReadVersion() { | |||
if (sharedStatePtr) { | |||
MutexHolder mutex(sharedStatePtr->mutexLock); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to plan a follow up task to optimize synchonization on the global cachedReadVersion. Mutex gives a reliable implementation, but it can introduce a significant overhead in a configuration with multiple FDB threads. I think we can replace mutex with atomics. It is not completely trivial, because the cachedReadVersion and lastGrvTime must be updated atomically, but it is doable. We can discuss it after you are done with this PR.
Doxense CI Report for Windows 10
|
AWS CodeBuild CI Report for Linux CentOS 7
|
AWS CodeBuild CI Report for macOS BigSur 11.5.2
|
Doxense CI Report for Windows 10
|
AWS CodeBuild CI Report for Linux CentOS 7
|
Testing done: 100k correctness passed at |
This PR is a follow-up to #5725 and adds functionality to the
fdb_c
andMultiVersionApi
related interfaces to support GRV caching behaving as expected, especially in commit->read (your own commits) patterns when there are multiple connections to the same cluster. The correctness is tested through the C API framework for multi-threaded operations introduced by #6433, enabled by setting the transaction option to use the GRV cache within the existing tests.Code-Reviewer Section
The general guidelines can be found here.
Please check each of the following things and check all boxes before accepting a PR.
For Release-Branches
If this PR is made against a release-branch, please also check the following:
release-branch
ormaster
if this is the youngest branch)