Skip to content

Commit a8b7c8c

Browse files
committed
WIP
1 parent 0edc50e commit a8b7c8c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

x/mongo/driver/operation.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,9 @@ func (op Operation) readWireMessage(ctx context.Context, conn *mnet.Connection)
11051105
res, err := op.decodeResult(opcode, rem)
11061106
// Update cluster/operation time and recovery tokens before handling the error to ensure we're properly updating
11071107
// everything.
1108-
op.updateClusterTimes(res)
1108+
if op.Clock != nil {
1109+
op.updateClusterTimes(res)
1110+
}
11091111
op.updateOperationTime(res)
11101112
op.Client.UpdateRecoveryToken(bson.Raw(res))
11111113

@@ -1699,7 +1701,10 @@ func (op Operation) addClusterTime(dst []byte, desc description.SelectedServer)
16991701
if (clock == nil && client == nil) || !sessionsSupported(desc.WireVersion) {
17001702
return dst
17011703
}
1702-
clusterTime := clock.GetClusterTime()
1704+
var clusterTime bson.Raw
1705+
if clock != nil {
1706+
clusterTime = clock.GetClusterTime()
1707+
}
17031708
if client != nil {
17041709
clusterTime = session.MaxClusterTime(clusterTime, client.ClusterTime)
17051710
}

x/mongo/driver/operation/hello.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ func isLegacyHandshake(srvAPI *driver.ServerAPIOptions, loadbalanced bool) bool
630630

631631
func (h *Hello) createOperation() driver.Operation {
632632
op := driver.Operation{
633-
Clock: h.clock,
633+
// Clock: h.clock,
634634
CommandFn: h.command,
635635
Database: "admin",
636636
Deployment: h.d,
@@ -663,7 +663,7 @@ func (h *Hello) GetHandshakeInformation(ctx context.Context, _ address.Address,
663663
deployment := driver.SingleConnectionDeployment{C: conn}
664664

665665
op := driver.Operation{
666-
Clock: h.clock,
666+
// Clock: h.clock,
667667
CommandFn: h.handshakeCommand,
668668
Deployment: deployment,
669669
Database: "admin",

0 commit comments

Comments
 (0)