Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 5 additions & 21 deletions mongodump/mongodump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,27 +378,11 @@ func setupTimeseriesWithMixedSchema(dbName string, collName string) error {
return createRes.Err()
}

// SERVER-84531 was only backported to 7.3.
// TODO: Run collMod command on 6.0 and 7.0 (TOOLS-3597).
clientFCV := testutil.GetFCV(client)

shouldAccommodateMixedSchema := clientFCV == "6.0" || clientFCV == "7.0"
if !shouldAccommodateMixedSchema {
cmp, err := testutil.CompareFCV(clientFCV, "7.3")
if err != nil {
return errors.Wrapf(err, "failed to compare client FCV (%s)", clientFCV)
}

shouldAccommodateMixedSchema = cmp >= 0
}

if shouldAccommodateMixedSchema {
if res := sessionProvider.DB(dbName).RunCommand(context.Background(), bson.D{
{"collMod", collName},
{"timeseriesBucketsMayHaveMixedSchemaData", true},
}); res.Err() != nil {
return res.Err()
}
if res := sessionProvider.DB(dbName).RunCommand(context.Background(), bson.D{
{"collMod", collName},
{"timeseriesBucketsMayHaveMixedSchemaData", true},
}); res.Err() != nil {
return res.Err()
}

bucketColl := sessionProvider.DB(dbName).Collection("system.buckets." + collName)
Expand Down
11 changes: 2 additions & 9 deletions mongorestore/mongorestore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2055,18 +2055,11 @@ func TestRestoreTimeseriesCollectionsWithMixedSchema(t *testing.T) {
fcv := testutil.GetFCV(session)
// TODO: Enable tests for 6.0, 7.0 and 8.0 (TOOLS-3597).
// The server fix for SERVER-84531 was only backported to 7.3.
if cmp, err := testutil.CompareFCV(fcv, "7.3"); cmp < 0 {
if cmp, err := testutil.CompareFCV(fcv, "6.0"); cmp < 0 {
if err != nil {
t.Fatalf("Failed to get FCV: %v", err)
}
t.Skip("Requires server with FCV 7.3 or later")
}

if cmp, err := testutil.CompareFCV(fcv, "8.0"); cmp >= 0 {
if err != nil {
t.Fatalf("Failed to get FCV: %v", err)
}
t.Skip("The test currently fails on v8.0 because of SERVER-92222")
t.Skip("Requires server with FCV 6.0 or later")
}

dbName := "timeseries_test_DB"
Expand Down