Skip to content

Commit 5b4bc26

Browse files
committed
update
1 parent 0d7a9bf commit 5b4bc26

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pbm/topo/cluster.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ type Shard struct {
3939
}
4040

4141
// ClusterTime returns mongo's current cluster time
42-
// TODO: add ccrs?
4342
func GetClusterTime(ctx context.Context, m connect.Client) (primitive.Timestamp, error) {
4443
// Make a read to force the cluster timestamp update.
4544
// Otherwise, cluster timestamp could remain the same between node info reads,
4645
// while in fact time has been moved forward.
47-
err := m.LockCollection().FindOne(ctx, bson.D{}).Err()
46+
err := m.MongoClient().Database("admin").Collection("system.version").FindOne(ctx, bson.D{}).Err()
4847
if err != nil && !errors.Is(err, mongo.ErrNoDocuments) {
4948
return primitive.Timestamp{}, errors.Wrap(err, "void read")
5049
}

sdk/impl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ func (c *Client) Restore(ctx context.Context, backupName string, clusterTS Times
366366
var ErrStaleHearbeat = errors.New("stale heartbeat")
367367

368368
func (c *Client) OpLocks(ctx context.Context) ([]OpLock, error) {
369-
locks, err := lock.GetLocks(ctx, c.conn, &lock.LockHeader{})
369+
locks, err := lock.GetLocks(ctx, c.ccrsConn, &lock.LockHeader{})
370370
if err != nil {
371371
return nil, errors.Wrap(err, "get locks")
372372
}

0 commit comments

Comments
 (0)