-
Notifications
You must be signed in to change notification settings - Fork 918
GODRIVER-3288 Stop gossiping $clusterTime on SDAM commands. #2150
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1103,9 +1103,11 @@ func (op Operation) readWireMessage(ctx context.Context, conn *mnet.Connection) | |
|
||
// decode | ||
res, err := op.decodeResult(opcode, rem) | ||
// Update cluster/operation time and recovery tokens before handling the error to ensure we're properly updating | ||
// everything. | ||
op.updateClusterTimes(res) | ||
// When a cluster clock is given, update cluster/operation time and recovery tokens before handling the error | ||
// to ensure we're properly updating everything. | ||
if op.Clock != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this block? Wouldn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to stop updating the cluster time in session too, so L1709 in addClusterTime() will not append a “$clusterTime”. |
||
op.updateClusterTimes(res) | ||
} | ||
op.updateOperationTime(res) | ||
op.Client.UpdateRecoveryToken(bson.Raw(res)) | ||
|
||
|
@@ -1699,7 +1701,10 @@ func (op Operation) addClusterTime(dst []byte, desc description.SelectedServer) | |
if (clock == nil && client == nil) || !sessionsSupported(desc.WireVersion) { | ||
return dst | ||
} | ||
clusterTime := clock.GetClusterTime() | ||
var clusterTime bson.Raw | ||
if clock != nil { | ||
clusterTime = clock.GetClusterTime() | ||
} | ||
if client != nil { | ||
clusterTime = session.MaxClusterTime(clusterTime, client.ClusterTime) | ||
} | ||
|
@@ -1711,7 +1716,6 @@ func (op Operation) addClusterTime(dst []byte, desc description.SelectedServer) | |
return dst | ||
} | ||
return append(bsoncore.AppendHeader(dst, bsoncore.Type(val.Type), "$clusterTime"), val.Value...) | ||
// return bsoncore.AppendDocumentElement(dst, "$clusterTime", clusterTime) | ||
} | ||
|
||
// calculateMaxTimeMS calculates the value of the 'maxTimeMS' field to potentially append | ||
|
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.
Suggest buffering these channels and adding a wait function: