Skip to content

Commit b43dfb2

Browse files
committed
Merge branch 'main' into REP-5218-roll-back-tasks
2 parents 88495a6 + 3f42f7d commit b43dfb2

Some content is hidden

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

62 files changed

+26757
-488
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@ module github.com/10gen/migration-verifier
33
go 1.20
44

55
require (
6+
github.com/cespare/permute/v2 v2.0.0-beta2
67
github.com/deckarep/golang-set/v2 v2.3.0
78
github.com/dustin/go-humanize v1.0.1
89
github.com/gin-gonic/gin v1.8.1
910
github.com/google/uuid v1.3.0
1011
github.com/olekukonko/tablewriter v0.0.5
1112
github.com/pkg/errors v0.9.1
1213
github.com/rs/zerolog v1.28.0
14+
github.com/samber/lo v1.47.0
1315
github.com/stretchr/testify v1.8.0
1416
github.com/urfave/cli v1.22.9
1517
go.mongodb.org/mongo-driver v1.17.1
16-
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
18+
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
1719
golang.org/x/sync v0.8.0
1820
gopkg.in/natefinch/lumberjack.v2 v2.0.0
1921
)
2022

2123
require (
2224
github.com/BurntSushi/toml v0.3.1 // indirect
23-
github.com/cespare/permute/v2 v2.0.0-beta2 // indirect
2425
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
2526
github.com/davecgh/go-spew v1.1.1 // indirect
2627
github.com/gin-contrib/sse v0.1.0 // indirect
@@ -50,7 +51,6 @@ require (
5051
golang.org/x/net v0.21.0 // indirect
5152
golang.org/x/sys v0.23.0 // indirect
5253
golang.org/x/text v0.17.0 // indirect
53-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
5454
google.golang.org/protobuf v1.28.0 // indirect
5555
gopkg.in/yaml.v2 v2.4.0 // indirect
5656
gopkg.in/yaml.v3 v3.0.1 // indirect

internal/documentmap/documentmap.go

Lines changed: 0 additions & 208 deletions
This file was deleted.

internal/documentmap/documentmap_test.go

Lines changed: 0 additions & 95 deletions
This file was deleted.

internal/partitions/partition.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ func (p *Partition) GetFindOptions(buildInfo *bson.M, filterAndPredicates bson.A
151151
sort := bson.E{"sort", bson.D{{"$natural", 1}}}
152152
findOptions = append(findOptions, sort)
153153
} else {
154+
// For non-capped collections, sort by _id to minimize the amount of time
155+
// that a given document spends cached in memory.
156+
findOptions = append(findOptions, bson.E{"sort", bson.D{{"_id", 1}}})
157+
154158
// For non-capped collections, the cursor should use the ID filter and the _id index.
155159
// Get the bounded query filter from the partition to be used in the Find command.
156160
allowTypeBracketing := false

internal/partitions/partition_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func (suite *UnitTestSuite) TestPartitionFindCmd() {
2323
{"afterClusterTime", startAt},
2424
}},
2525
{"noCursorTimeout", true},
26+
{"sort", bson.D{{"_id", 1}}},
2627
{"hint", bson.D{{"_id", 1}}},
2728
{"filter", expectedFilter},
2829
}

0 commit comments

Comments
 (0)