summaryrefslogtreecommitdiff
path: root/jstests/replsets/read_committed_with_catalog_changes.js
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2017-06-27 11:37:52 -0400
committerBenety Goh <benety@mongodb.com>2017-06-28 12:40:50 -0400
commit58518c5174a1854060428e183ac6049c64ac0517 (patch)
tree8ce4a001689a62a8e70f162ebf3cf733319820e5 /jstests/replsets/read_committed_with_catalog_changes.js
parentb5aea02f2d5eed1e75cfde8cf5c7fb5f87bd4f7f (diff)
downloadmongo-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.js14
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}));
},