Skip to content

Commit 640a8c2

Browse files
committed
Revert "tweak"
This reverts commit 229ac9a.
1 parent 7126acd commit 640a8c2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

internal/verifier/clustertime.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
"github.com/10gen/migration-verifier/internal/logger"
77
"github.com/10gen/migration-verifier/internal/retry"
8+
"github.com/10gen/migration-verifier/internal/util"
89
"github.com/10gen/migration-verifier/mbson"
910
"github.com/pkg/errors"
1011
"go.mongodb.org/mongo-driver/bson"
@@ -70,15 +71,22 @@ func fetchNewClusterTime(
7071
ctx context.Context,
7172
client *mongo.Client,
7273
) (primitive.Timestamp, error) {
73-
_, rawResponse, err := runAppendOplogNote(
74+
cmd, rawResponse, err := runAppendOplogNote(
7475
ctx,
7576
client,
7677
"expect StaleClusterTime error",
7778
)
78-
if err != nil {
79+
80+
// We expect an error here; if we didn't get one then something is
81+
// amiss on the server.
82+
if err == nil {
83+
return primitive.Timestamp{}, errors.Errorf("server request unexpectedly succeeded: %v", cmd)
84+
}
85+
86+
if !util.IsStaleClusterTimeError(err) {
7987
return primitive.Timestamp{}, errors.Wrap(
8088
err,
81-
"failed to append note to oplog",
89+
"unexpected error (expected StaleClusterTime) from request",
8290
)
8391
}
8492

0 commit comments

Comments
 (0)