diff options
author | Benety Goh <benety@mongodb.com> | 2017-06-27 11:37:52 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2017-06-28 12:40:50 -0400 |
commit | 58518c5174a1854060428e183ac6049c64ac0517 (patch) | |
tree | 8ce4a001689a62a8e70f162ebf3cf733319820e5 /jstests/replsets/read_committed_with_catalog_changes.js | |
parent | b5aea02f2d5eed1e75cfde8cf5c7fb5f87bd4f7f (diff) | |
download | mongo-58518c5174a1854060428e183ac6049c64ac0517.tar.gz |
SERVER-29876 read_committed_with_catalog_changes.js drops collection during the preparation phase instead of during the performOp phase so that dropDatabase does not block
Diffstat (limited to 'jstests/replsets/read_committed_with_catalog_changes.js')
-rw-r--r-- | jstests/replsets/read_committed_with_catalog_changes.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/jstests/replsets/read_committed_with_catalog_changes.js b/jstests/replsets/read_committed_with_catalog_changes.js index bd52fb109cc..dc67333cca6 100644 --- a/jstests/replsets/read_committed_with_catalog_changes.js +++ b/jstests/replsets/read_committed_with_catalog_changes.js @@ -68,11 +68,12 @@ load("jstests/replsets/rslib.js"); // For startSetIfSupportsReadMajority. dropDB: { prepare: function(db) { assert.writeOK(db.coll.insert({_id: 1})); - }, - performOp: function(db) { - // Drop collection explicitly. Otherwise, dropDatabase() will drop the collection + // Drop collection explicitly during the preparation phase while we are still able + // to write to a majority. Otherwise, dropDatabase() will drop the collection // and wait for the collection drop to be replicated to a majority of the nodes. assert(db.coll.drop()); + }, + performOp: function(db) { assert.commandWorked(db.dropDatabase()); }, blockedCollections: [], @@ -93,11 +94,12 @@ load("jstests/replsets/rslib.js"); // For startSetIfSupportsReadMajority. dropAndRecreateDB: { prepare: function(db) { assert.writeOK(db.coll.insert({_id: 1})); - }, - performOp: function(db) { - // Drop collection explicitly. Otherwise, dropDatabase() will drop the collection + // Drop collection explicitly during the preparation phase while we are still able + // to write to a majority. Otherwise, dropDatabase() will drop the collection // and wait for the collection drop to be replicated to a majority of the nodes. assert(db.coll.drop()); + }, + performOp: function(db) { assert.commandWorked(db.dropDatabase()); assert.writeOK(db.coll.insert({_id: 1})); }, |