-
Notifications
You must be signed in to change notification settings - Fork 911
GODRIVER-2277 Remove causal consistency prose test #10 #879
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
GODRIVER-2277 Remove causal consistency prose test #10 #879
Conversation
@@ -193,21 +192,6 @@ func TestCausalConsistency_Supported(t *testing.T) { | |||
assert.NotNil(mt, sentOptime, "expected operation time on command, got nil") | |||
assert.True(mt, currOptime.Equal(*sentOptime), "expected operation time %v, got %v", currOptime, sentOptime) | |||
}) | |||
unackWcOpts := options.Collection().SetWriteConcern(writeconcern.New(writeconcern.W(0))) | |||
mt.RunOpts("unacknowledged write", mtest.NewOptions().CollectionOptions(unackWcOpts), func(mt *mtest.T) { |
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.
Just curious, in what situations does this test fail? It does not fail locally for me against a 5.0 replica set.
do we want to tweak the test to assert that doing an unacknowledged write within a session results in an error?
If this is client-side error (thrown within the driver), then that could be a valuable test. If the server just doesn't support unacknowledged writes with explicit sessions, then I don't think we need to test that behavior on our side.
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.
The test should fail if the 0
-number write concern being sent over the wire is acknowledged, which should request[s] no acknowledgment of the write operation.
The error itself is thrown by the *mongo.Collection.InsertOne
method, specifically whenever the wire message flag is moreToCome
. I can see how we determine this message from the code base, but have no idea why the relationship between unacknowledged writes and moreToCome
is 1-1. The server does not explicitly create an error for this and it is technically recommended behavior.
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.
…thub.com:prestonvasquez/mongo-go-driver into GODRIVER-2277.removeCausalConsistencyProseTest10
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.
Looks good 👍 with one suggestion.
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.
Awesome thanks for the test replacement to maintain coverage 👍
@@ -193,21 +192,6 @@ func TestCausalConsistency_Supported(t *testing.T) { | |||
assert.NotNil(mt, sentOptime, "expected operation time on command, got nil") | |||
assert.True(mt, currOptime.Equal(*sentOptime), "expected operation time %v, got %v", currOptime, sentOptime) | |||
}) | |||
unackWcOpts := options.Collection().SetWriteConcern(writeconcern.New(writeconcern.W(0))) | |||
mt.RunOpts("unacknowledged write", mtest.NewOptions().CollectionOptions(unackWcOpts), func(mt *mtest.T) { |
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.
GODRIVER-2277
Prose Test no. 10 in the Causal Consistency Specification, to validate
nil
operation time when executed in a client session, is outdated per SPEC-1019 which "prohibit[s] unack'd writes in a session".The work to implement the change in SPEC-1019 for the GODRIVER team was completed by the work done on GODRIVER-52, specifically with PR#77.
Add a
TestSessions
subtest to ensure that mongo-go-driver errors on unacknowledged writes (i.e. a0
-number write concern) during a session.Question(s)