-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Don't gossip cluster time from monitoring connections #1276
Conversation
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.
This is quite an interesting bug 👍 I almost wish we had more or those
I think it might be more beneficial to maintain gossiping from monitoring connections. My thought is that this enhances the synchronization of the logical clock across the shards, particularly during periods of low client application read/write activity. However, the cluster clock is advanced at a lower level in the code, while we only check if it's from the wrong cluster at the upper level. This seems to be an inherent limitation to fixing this issue and maintaining additional gossiping. |
…as a parameter is unused, so just removed it as well as its test.
After some more research, I realized that it's also useful to not gossip cluster time during the handshake. It turns out the driver was already not doing that anyway, but while confirming that I found some unused cluster clock code in CommandHelper that I've removed in a follow-on commit (the unused method is the one that the server monitor used before the changes in the initial commit). |
MongoDB
See Implementation of Cluster-wide Logical Clock and Causal Consistency in MongoDB for more details, though I wish the paper were clearer in the "A2.2 Progressing Time in the Presente of no State Changes" section. Fortunately, there is this comment in Jira that clarifies that section to an extent. |
@vbabanin I forgot to tag you originally. The comment #1276 (comment) is a reply to you. |
JAVA-5256
The driver is compliant with https://github.com/mongodb/specifications/blob/master/source/sessions/driver-sessions.rst#gossipping-the-cluster-time, but in the case reported, the driver connects to a member of a different replica set and by the time it realizes that the server should be discarded it's too late. We can address this by not gossiping cluster time from monitoring connections.