diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-08-27 13:52:23 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-08-27 13:52:23 +0000 |
commit | 077f247b29e9f6c5afecec11bb41858ae95067b6 (patch) | |
tree | 090fe306fe92910a0427b0287e1763cac34ef2b9 /jstests/change_streams | |
parent | e650acdf68952bf967e9eb9cd2a8d990a4c502da (diff) | |
download | mongo-077f247b29e9f6c5afecec11bb41858ae95067b6.tar.gz |
Revert "SERVER-33272 Proactively close newly empty databases"
This reverts commit 40f226b5a9bfb4863268334d287a46fb226a22cf.
Diffstat (limited to 'jstests/change_streams')
4 files changed, 5 insertions, 33 deletions
diff --git a/jstests/change_streams/whole_cluster.js b/jstests/change_streams/whole_cluster.js index f9c47ee1c4f..a1cc114cd9a 100644 --- a/jstests/change_streams/whole_cluster.js +++ b/jstests/change_streams/whole_cluster.js @@ -11,12 +11,6 @@ db = db.getSiblingDB(jsTestName()); const adminDB = db.getSiblingDB("admin"); const otherDB = db.getSiblingDB(jsTestName() + "_other"); -// Create additional collections to prevent the databases from being closed when the other -// collections are dropped. -assert.commandWorkedOrFailedWithCode(db.createCollection("unused"), ErrorCodes.NamespaceExists); -assert.commandWorkedOrFailedWithCode(otherDB.createCollection("unused"), - ErrorCodes.NamespaceExists); - // Drop and recreate the collections to be used in this set of tests. assertDropAndRecreateCollection(db, "t1"); assertDropAndRecreateCollection(otherDB, "t2"); @@ -71,13 +65,12 @@ const validUserDBs = [ "_config_" ]; validUserDBs.forEach(dbName => { - const collName = "test" + Random.srand(); - assert.commandWorked(db.getSiblingDB(dbName).getCollection(collName).insert({_id: 0, a: 1})); + assert.commandWorked(db.getSiblingDB(dbName).test.insert({_id: 0, a: 1})); expected = [ { documentKey: {_id: 0}, fullDocument: {_id: 0, a: 1}, - ns: {db: dbName, coll: collName}, + ns: {db: dbName, coll: "test"}, operationType: "insert", }, ]; @@ -108,9 +101,7 @@ filteredDBs.forEach(dbName => { if (FixtureHelpers.isMongos(db) && dbName == "local") return; - const collName = "test" + Random.srand(); - assert.commandWorked(db.getSiblingDB(dbName).getCollection(collName).insert({_id: 0, a: 1})); - + assert.commandWorked(db.getSiblingDB(dbName).test.insert({_id: 0, a: 1})); // Insert to the test collection to ensure that the change stream has something to // return. assert.commandWorked(db.t1.insert({_id: dbName})); @@ -125,7 +116,7 @@ filteredDBs.forEach(dbName => { cst.assertNextChangesEqual({cursor: cursor, expectedChanges: expected}); // Drop the test collection to avoid duplicate key errors if this test is run multiple // times. - assertDropCollection(db.getSiblingDB(dbName), collName); + assertDropCollection(db.getSiblingDB(dbName), "test"); }); // Dropping a database should generate drop entries for each collection followed by a database diff --git a/jstests/change_streams/whole_cluster_metadata_notifications.js b/jstests/change_streams/whole_cluster_metadata_notifications.js index 839684a054e..8c72df1ba44 100644 --- a/jstests/change_streams/whole_cluster_metadata_notifications.js +++ b/jstests/change_streams/whole_cluster_metadata_notifications.js @@ -18,13 +18,6 @@ const adminDB = db.getSiblingDB("admin"); assert.commandWorked(testDB1.dropDatabase()); assert.commandWorked(testDB2.dropDatabase()); -// Create additional collections to prevent the databases from being closed when the other -// collections are dropped. -assert.commandWorkedOrFailedWithCode(testDB1.createCollection("unused"), - ErrorCodes.NamespaceExists); -assert.commandWorkedOrFailedWithCode(testDB2.createCollection("unused"), - ErrorCodes.NamespaceExists); - // Create one collection on each database. let [db1Coll, db2Coll] = [testDB1, testDB2].map((testDB) => assertDropAndRecreateCollection(testDB, "test")); diff --git a/jstests/change_streams/whole_cluster_resumability.js b/jstests/change_streams/whole_cluster_resumability.js index 6b6d28d76cf..8564d01e770 100644 --- a/jstests/change_streams/whole_cluster_resumability.js +++ b/jstests/change_streams/whole_cluster_resumability.js @@ -8,13 +8,6 @@ load("jstests/libs/fixture_helpers.js"); // For FixtureHelpers. // Create two databases, with one collection in each. const testDBs = [db.getSiblingDB(jsTestName()), db.getSiblingDB(jsTestName() + "_other")]; - -// Create additional collections to prevent the databases from being closed when the other -// collections are dropped. -testDBs.map((db) => { - assert.commandWorkedOrFailedWithCode(db.createCollection("unused"), ErrorCodes.NamespaceExists); -}); - let [db1Coll, db2Coll] = testDBs.map((db) => assertDropAndRecreateCollection(db, "test")); const adminDB = db.getSiblingDB("admin"); diff --git a/jstests/change_streams/whole_db_resumability.js b/jstests/change_streams/whole_db_resumability.js index 725035c193c..2e2c0e183ec 100644 --- a/jstests/change_streams/whole_db_resumability.js +++ b/jstests/change_streams/whole_db_resumability.js @@ -9,13 +9,8 @@ load("jstests/libs/collection_drop_recreate.js"); // For assert[Drop|Create]Col load("jstests/libs/change_stream_util.js"); // For ChangeStreamTest. load("jstests/libs/fixture_helpers.js"); // For FixtureHelpers. -const testDB = db.getSiblingDB(jsTestName()); - -// Create an additional collection to prevent the database from being closed when the other -// collection is dropped. -assert.commandWorkedOrFailedWithCode(testDB.createCollection("unused"), ErrorCodes.NamespaceExists); - // Drop and recreate the collections to be used in this set of tests. +const testDB = db.getSiblingDB(jsTestName()); let coll = assertDropAndRecreateCollection(testDB, "resume_coll"); const otherColl = assertDropAndRecreateCollection(testDB, "resume_coll_other"); |