Skip to content

Commit

Permalink
deps Nov 2023 (#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
defbin authored Nov 27, 2023
1 parent 3b1c2e2 commit 6871352
Show file tree
Hide file tree
Showing 517 changed files with 47,458 additions and 9,900 deletions.
4 changes: 2 additions & 2 deletions cli/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,11 @@ func printCleanupInfoTo(w io.Writer, backups []pbm.BackupMeta, chunks []pbm.Oplo
}

lastWrite := &rs[len(rs)-1].End
if primitive.CompareTimestamp(*lastWrite, c.StartTS) == -1 {
if lastWrite.Compare(c.StartTS) == -1 {
oplogRanges[c.RS] = append(rs, oplogRange{c.StartTS, c.EndTS})
continue
}
if primitive.CompareTimestamp(*lastWrite, c.EndTS) == -1 {
if lastWrite.Compare(c.EndTS) == -1 {
*lastWrite = c.EndTS
}
}
Expand Down
8 changes: 2 additions & 6 deletions cli/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,7 @@ func connect(ctx context.Context, uri, hosts string) (*mongo.Client, error) {
curi.RawQuery = query.Encode()
curi.Host = host

conn, err := mongo.NewClient(options.Client().ApplyURI(curi.String()).SetAppName("pbm-status"))
if err != nil {
return nil, errors.Wrap(err, "create mongo client")
}
err = conn.Connect(ctx)
conn, err := mongo.Connect(ctx, options.Client().ApplyURI(curi.String()).SetAppName("pbm-status"))
if err != nil {
return nil, errors.Wrap(err, "connect")
}
Expand Down Expand Up @@ -724,7 +720,7 @@ func getPITRranges(cn *pbm.PBM, bcps []pbm.BackupMeta, rsMap map[string]string)
}

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

var pr []pitrRange
Expand Down
8 changes: 4 additions & 4 deletions e2e-tests/cmd/ensure-oplog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,23 +358,23 @@ func findChunkRanges(rs []pbm.OplogChunk, from, till primitive.Timestamp) []time
rv := []timerange{}

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

endTS := c.EndTS
for _, c = range rs[1:] {
if primitive.CompareTimestamp(endTS, c.StartTS) == -1 {
if endTS.Compare(c.StartTS) == -1 {
rv = append(rv, timerange{endTS, c.StartTS})
}
if primitive.CompareTimestamp(till, c.EndTS) != 1 {
if till.Compare(c.EndTS) != 1 {
return rv
}

endTS = c.EndTS
}

if primitive.CompareTimestamp(endTS, till) == -1 {
if endTS.Compare(till) == -1 {
rv = append(rv, timerange{endTS, till})
}

Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/pkg/pbm/clock_skew.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func ClockSkew(rsName, ts, dockerHost string) error {
log.Printf("== Skew the clock for %s on the replicaset %s ", ts, rsName)

cn, err := docker.NewClient(dockerHost, "1.39", nil, nil)
cn, err := docker.NewClientWithOpts(docker.WithHost(dockerHost))
if err != nil {
return errors.Wrap(err, "docker client")
}
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/pkg/pbm/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Docker struct {
}

func NewDocker(ctx context.Context, host string) (*Docker, error) {
cn, err := docker.NewClient(host, "1.39", nil, nil)
cn, err := docker.NewClientWithOpts(docker.WithHost(host))
if err != nil {
return nil, errors.Wrap(err, "docker client")
}
Expand Down
8 changes: 2 additions & 6 deletions e2e-tests/pkg/pbm/mongod.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,13 @@ func NewMongo(ctx context.Context, connectionURI string) (*Mongo, error) {
}

func connect(ctx context.Context, uri, appName string) (*mongo.Client, error) {
client, err := mongo.NewClient(
client, err := mongo.Connect(ctx,
options.Client().ApplyURI(uri).
SetAppName(appName).
SetReadPreference(readpref.Primary()).
SetReadConcern(readconcern.Majority()).
SetWriteConcern(writeconcern.New(writeconcern.WMajority())),
SetWriteConcern(writeconcern.Majority()),
)
if err != nil {
return nil, errors.Wrap(err, "create mongo client")
}
err = client.Connect(ctx)
if err != nil {
return nil, errors.Wrap(err, "mongo connect")
}
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/pkg/pbm/pbm_ctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Ctl struct {
var backupNameRE = regexp.MustCompile(`Starting backup '([0-9\-\:TZ]+)'`)

func NewCtl(ctx context.Context, host, pbmContainer string) (*Ctl, error) {
cn, err := docker.NewClient(host, "1.39", nil, nil)
cn, err := docker.NewClientWithOpts(docker.WithHost(host))
if err != nil {
return nil, errors.Wrap(err, "docker client")
}
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/pkg/tests/sharded/test_bounds_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ type scounter struct {
}

func lte(t1, t2 primitive.Timestamp) bool {
return primitive.CompareTimestamp(t1, t2) <= 0
return t1.Compare(t2) <= 0
}

func lt(t1, t2 primitive.Timestamp) bool {
return primitive.CompareTimestamp(t1, t2) < 0
return t1.Compare(t2) < 0
}

func (c *Cluster) BackupBoundsCheck(typ pbm.BackupType, mongoVersion string) {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/pkg/tests/sharded/test_oplog_replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func getLastWrittenCounter(counters map[string]shardCounter) tpbm.Counter {
log.Printf("\tshard %s: %d [%v] | %v",
name, cc.WriteTime.T, time.Unix(int64(cc.WriteTime.T), 0), cc)

if primitive.CompareTimestamp(rv.WriteTime, cc.WriteTime) == -1 {
if rv.WriteTime.Compare(cc.WriteTime) == -1 {
rv = cc
}
}
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/pkg/tests/sharded/trx.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (c *Cluster) DistributedTransactions(bcp Backuper, col string) {
SetDefaultReadPreference(readpref.Primary()).
SetCausalConsistency(true).
SetDefaultReadConcern(readconcern.Majority()).
SetDefaultWriteConcern(writeconcern.New(writeconcern.WMajority())),
SetDefaultWriteConcern(writeconcern.Majority()),
)
if err != nil {
log.Fatalln("ERROR: start session:", err)
Expand Down Expand Up @@ -205,7 +205,7 @@ func (c *Cluster) printBalancerStatus(ctx context.Context) {
bson.D{{"balancerStatus", 1}},
)

state, err := br.DecodeBytes()
state, err := br.Raw()
if err != nil {
log.Fatalln("ERROR: balancerStatus:", err)
}
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/pkg/tests/sharded/trx_phys.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (c *Cluster) DistributedTransactionsPhys(bcp Backuper, col string) {
SetDefaultReadPreference(readpref.Primary()).
SetCausalConsistency(true).
SetDefaultReadConcern(readconcern.Majority()).
SetDefaultWriteConcern(writeconcern.New(writeconcern.WMajority())),
SetDefaultWriteConcern(writeconcern.Majority()),
)
if err != nil {
log.Fatalln("ERROR: start session:", err)
Expand Down
43 changes: 22 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,35 @@ module github.com/percona/percona-backup-mongodb
go 1.19

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.1.0
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0
github.com/alecthomas/kingpin v2.2.6+incompatible
github.com/aws/aws-sdk-go v1.44.312
github.com/docker/docker v24.0.5+incompatible
github.com/aws/aws-sdk-go v1.48.4
github.com/docker/docker v24.0.7+incompatible
github.com/golang/snappy v0.0.4
github.com/google/uuid v1.3.0
github.com/klauspost/compress v1.16.7
github.com/google/uuid v1.4.0
github.com/klauspost/compress v1.17.3
github.com/klauspost/pgzip v1.2.6
github.com/minio/minio-go v6.0.14+incompatible
github.com/mongodb/mongo-tools v0.0.0-20230720205640-fb74684da15f
github.com/mongodb/mongo-tools v0.0.0-20231117185435-bf0bef9e9f19
github.com/pierrec/lz4 v2.6.1+incompatible
github.com/pkg/errors v0.9.1
go.mongodb.org/mongo-driver v1.12.0
golang.org/x/mod v0.12.0
golang.org/x/sync v0.3.0
go.mongodb.org/mongo-driver v1.13.0
golang.org/x/mod v0.14.0
golang.org/x/sync v0.5.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/frankban/quicktest v1.14.5 // indirect
github.com/frankban/quicktest v1.14.6 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/jessevdk/go-flags v1.5.0 // indirect
Expand All @@ -45,13 +46,13 @@ require (
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/term v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.6.0 // indirect
gotest.tools/v3 v3.5.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.4.0 // indirect
golang.org/x/tools v0.13.0 // indirect
gotest.tools/v3 v3.5.1 // indirect
)
Loading

0 comments on commit 6871352

Please sign in to comment.