(function() {
|
load("jstests/libs/write_concern_util.js");
|
|
let rst = new ReplSetTest({nodes: [{rsConfig: {votes: 1}}, {rsConfig: {priority: 0, votes: 0}}]});
|
rst.startSet();
|
rst.initiate();
|
|
// Create "test" database.
|
assert.writeOK(rst.getPrimary().getDB("test").coll.insert({_id: 0}));
|
|
// Stop replication on the secondary.
|
stopServerReplication(rst.getSecondary());
|
|
// Drop and recreate the database.
|
assert.commandWorked(rst.getPrimary().getDB("test").runCommand({dropDatabase: 1}));
|
assert.writeOK(rst.getPrimary().getDB("test").coll.insert({_id: 0}));
|
|
// Set the profiling level on the secondary. This succeeds.
|
assert.commandWorked(rst.getSecondary().getDB("test").setProfilingLevel(1));
|
assert.eq(1, rst.getSecondary().getDB("test").getProfilingLevel());
|
|
// Restart replication on the secondary.
|
restartServerReplication(rst.getSecondary());
|
rst.awaitReplication();
|
|
// Profiling is turned off on the secondary.
|
assert.eq(0, rst.getSecondary().getDB("test").getProfilingLevel());
|
|
rst.stopSet();
|
})();
|