diff options
author | Blake Oler <blake.oler@mongodb.com> | 2018-10-10 10:48:11 -0400 |
---|---|---|
committer | Blake Oler <blake.oler@mongodb.com> | 2018-10-13 17:47:24 -0400 |
commit | 6894b72f134534c3739a66ed9eee11e265b9c1e1 (patch) | |
tree | 141d2c0600511357c8edf93ba5c4a7070be47b0f /jstests | |
parent | aa89fef4ac12249077ff8701b465d0b9f733fd2c (diff) | |
download | mongo-6894b72f134534c3739a66ed9eee11e265b9c1e1.tar.gz |
SERVER-36964 Prevent secondaries in SessionsCollectionRS from attempting to set up the sessions collection.
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/replsets/refresh_sessions_rs.js | 6 | ||||
-rw-r--r-- | jstests/replsets/sessions_collection_auto_healing.js | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/jstests/replsets/refresh_sessions_rs.js b/jstests/replsets/refresh_sessions_rs.js index 3a5cdd98218..4539e667d07 100644 --- a/jstests/replsets/refresh_sessions_rs.js +++ b/jstests/replsets/refresh_sessions_rs.js @@ -26,9 +26,13 @@ var res; - // Trigger an initial refresh on all members, as a sanity check. + // The primary needs to create the sessions collection so that the secondaries can act upon it. + // This is done by an initial refresh of the primary. res = db1.runCommand(refresh); assert.commandWorked(res, "failed to refresh"); + replTest.awaitReplication(); + + // Trigger an initial refresh on secondaries as a sanity check. res = db2.runCommand(refresh); assert.commandWorked(res, "failed to refresh"); res = db3.runCommand(refresh); diff --git a/jstests/replsets/sessions_collection_auto_healing.js b/jstests/replsets/sessions_collection_auto_healing.js index c56fb24639a..ed332241921 100644 --- a/jstests/replsets/sessions_collection_auto_healing.js +++ b/jstests/replsets/sessions_collection_auto_healing.js @@ -45,7 +45,7 @@ load('jstests/libs/sessions_collection.js'); validateSessionsCollection(secondary, false, false); } - // Test that a refresh on a secondary creates the sessions collection. + // Test that a refresh on a secondary does not create the sessions collection. { validateSessionsCollection(primary, false, false); @@ -54,15 +54,13 @@ load('jstests/libs/sessions_collection.js'); assert.commandWorked(secondaryAdmin.runCommand({refreshLogicalSessionCacheNow: 1})); - validateSessionsCollection(primary, true, true); + validateSessionsCollection(primary, false, false); replTest.awaitReplication(); - validateSessionsCollection(secondary, true, true); + validateSessionsCollection(secondary, false, false); } // Test that a refresh on the primary creates the sessions collection. { - assert.commandWorked(primary.getDB("config").runCommand( - {drop: "system.sessions", writeConcern: {w: "majority"}})); validateSessionsCollection(primary, false, false); replTest.awaitReplication(); @@ -73,7 +71,7 @@ load('jstests/libs/sessions_collection.js'); validateSessionsCollection(primary, true, true); } - // Test that a refresh on a secondary will create the TTL index on the sessions collection. + // Test that a refresh on a secondary will not create the TTL index on the sessions collection. { assert.commandWorked(primary.getDB("config").system.sessions.dropIndex({lastUse: 1})); @@ -81,13 +79,11 @@ load('jstests/libs/sessions_collection.js'); assert.commandWorked(secondaryAdmin.runCommand({refreshLogicalSessionCacheNow: 1})); - validateSessionsCollection(primary, true, true); + validateSessionsCollection(primary, true, false); } // Test that a refresh on the primary will create the TTL index on the sessions collection. { - assert.commandWorked(primary.getDB("config").system.sessions.dropIndex({lastUse: 1})); - validateSessionsCollection(primary, true, false); assert.commandWorked(primaryAdmin.runCommand({refreshLogicalSessionCacheNow: 1})); |