Skip to content

Commit 29dad4b

Browse files
committed
deps Nov 2023 (#894)
1 parent 3b1c2e2 commit 29dad4b

File tree

517 files changed

+47458
-9900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

517 files changed

+47458
-9900
lines changed

cli/delete.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,11 @@ func printCleanupInfoTo(w io.Writer, backups []pbm.BackupMeta, chunks []pbm.Oplo
304304
}
305305

306306
lastWrite := &rs[len(rs)-1].End
307-
if primitive.CompareTimestamp(*lastWrite, c.StartTS) == -1 {
307+
if lastWrite.Compare(c.StartTS) == -1 {
308308
oplogRanges[c.RS] = append(rs, oplogRange{c.StartTS, c.EndTS})
309309
continue
310310
}
311-
if primitive.CompareTimestamp(*lastWrite, c.EndTS) == -1 {
311+
if lastWrite.Compare(c.EndTS) == -1 {
312312
*lastWrite = c.EndTS
313313
}
314314
}

cli/status.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,7 @@ func connect(ctx context.Context, uri, hosts string) (*mongo.Client, error) {
312312
curi.RawQuery = query.Encode()
313313
curi.Host = host
314314

315-
conn, err := mongo.NewClient(options.Client().ApplyURI(curi.String()).SetAppName("pbm-status"))
316-
if err != nil {
317-
return nil, errors.Wrap(err, "create mongo client")
318-
}
319-
err = conn.Connect(ctx)
315+
conn, err := mongo.Connect(ctx, options.Client().ApplyURI(curi.String()).SetAppName("pbm-status"))
320316
if err != nil {
321317
return nil, errors.Wrap(err, "connect")
322318
}
@@ -724,7 +720,7 @@ func getPITRranges(cn *pbm.PBM, bcps []pbm.BackupMeta, rsMap map[string]string)
724720
}
725721

726722
sort.Slice(bcps, func(i, j int) bool {
727-
return primitive.CompareTimestamp(bcps[i].LastWriteTS, bcps[j].LastWriteTS) == -1
723+
return bcps[i].LastWriteTS.Compare(bcps[j].LastWriteTS) == -1
728724
})
729725

730726
var pr []pitrRange

e2e-tests/cmd/ensure-oplog/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,23 +358,23 @@ func findChunkRanges(rs []pbm.OplogChunk, from, till primitive.Timestamp) []time
358358
rv := []timerange{}
359359

360360
c := rs[0]
361-
if primitive.CompareTimestamp(from, c.StartTS) == -1 {
361+
if from.Compare(c.StartTS) == -1 {
362362
rv = append(rv, timerange{from, c.StartTS})
363363
}
364364

365365
endTS := c.EndTS
366366
for _, c = range rs[1:] {
367-
if primitive.CompareTimestamp(endTS, c.StartTS) == -1 {
367+
if endTS.Compare(c.StartTS) == -1 {
368368
rv = append(rv, timerange{endTS, c.StartTS})
369369
}
370-
if primitive.CompareTimestamp(till, c.EndTS) != 1 {
370+
if till.Compare(c.EndTS) != 1 {
371371
return rv
372372
}
373373

374374
endTS = c.EndTS
375375
}
376376

377-
if primitive.CompareTimestamp(endTS, till) == -1 {
377+
if endTS.Compare(till) == -1 {
378378
rv = append(rv, timerange{endTS, till})
379379
}
380380

e2e-tests/pkg/pbm/clock_skew.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func ClockSkew(rsName, ts, dockerHost string) error {
1616
log.Printf("== Skew the clock for %s on the replicaset %s ", ts, rsName)
1717

18-
cn, err := docker.NewClient(dockerHost, "1.39", nil, nil)
18+
cn, err := docker.NewClientWithOpts(docker.WithHost(dockerHost))
1919
if err != nil {
2020
return errors.Wrap(err, "docker client")
2121
}

e2e-tests/pkg/pbm/docker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type Docker struct {
2121
}
2222

2323
func NewDocker(ctx context.Context, host string) (*Docker, error) {
24-
cn, err := docker.NewClient(host, "1.39", nil, nil)
24+
cn, err := docker.NewClientWithOpts(docker.WithHost(host))
2525
if err != nil {
2626
return nil, errors.Wrap(err, "docker client")
2727
}

e2e-tests/pkg/pbm/mongod.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,13 @@ func NewMongo(ctx context.Context, connectionURI string) (*Mongo, error) {
3636
}
3737

3838
func connect(ctx context.Context, uri, appName string) (*mongo.Client, error) {
39-
client, err := mongo.NewClient(
39+
client, err := mongo.Connect(ctx,
4040
options.Client().ApplyURI(uri).
4141
SetAppName(appName).
4242
SetReadPreference(readpref.Primary()).
4343
SetReadConcern(readconcern.Majority()).
44-
SetWriteConcern(writeconcern.New(writeconcern.WMajority())),
44+
SetWriteConcern(writeconcern.Majority()),
4545
)
46-
if err != nil {
47-
return nil, errors.Wrap(err, "create mongo client")
48-
}
49-
err = client.Connect(ctx)
5046
if err != nil {
5147
return nil, errors.Wrap(err, "mongo connect")
5248
}

e2e-tests/pkg/pbm/pbm_ctl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Ctl struct {
2727
var backupNameRE = regexp.MustCompile(`Starting backup '([0-9\-\:TZ]+)'`)
2828

2929
func NewCtl(ctx context.Context, host, pbmContainer string) (*Ctl, error) {
30-
cn, err := docker.NewClient(host, "1.39", nil, nil)
30+
cn, err := docker.NewClientWithOpts(docker.WithHost(host))
3131
if err != nil {
3232
return nil, errors.Wrap(err, "docker client")
3333
}

e2e-tests/pkg/tests/sharded/test_bounds_check.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ type scounter struct {
1919
}
2020

2121
func lte(t1, t2 primitive.Timestamp) bool {
22-
return primitive.CompareTimestamp(t1, t2) <= 0
22+
return t1.Compare(t2) <= 0
2323
}
2424

2525
func lt(t1, t2 primitive.Timestamp) bool {
26-
return primitive.CompareTimestamp(t1, t2) < 0
26+
return t1.Compare(t2) < 0
2727
}
2828

2929
func (c *Cluster) BackupBoundsCheck(typ pbm.BackupType, mongoVersion string) {

e2e-tests/pkg/tests/sharded/test_oplog_replay.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func getLastWrittenCounter(counters map[string]shardCounter) tpbm.Counter {
8989
log.Printf("\tshard %s: %d [%v] | %v",
9090
name, cc.WriteTime.T, time.Unix(int64(cc.WriteTime.T), 0), cc)
9191

92-
if primitive.CompareTimestamp(rv.WriteTime, cc.WriteTime) == -1 {
92+
if rv.WriteTime.Compare(cc.WriteTime) == -1 {
9393
rv = cc
9494
}
9595
}

e2e-tests/pkg/tests/sharded/trx.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (c *Cluster) DistributedTransactions(bcp Backuper, col string) {
7979
SetDefaultReadPreference(readpref.Primary()).
8080
SetCausalConsistency(true).
8181
SetDefaultReadConcern(readconcern.Majority()).
82-
SetDefaultWriteConcern(writeconcern.New(writeconcern.WMajority())),
82+
SetDefaultWriteConcern(writeconcern.Majority()),
8383
)
8484
if err != nil {
8585
log.Fatalln("ERROR: start session:", err)
@@ -205,7 +205,7 @@ func (c *Cluster) printBalancerStatus(ctx context.Context) {
205205
bson.D{{"balancerStatus", 1}},
206206
)
207207

208-
state, err := br.DecodeBytes()
208+
state, err := br.Raw()
209209
if err != nil {
210210
log.Fatalln("ERROR: balancerStatus:", err)
211211
}

0 commit comments

Comments
 (0)