summaryrefslogtreecommitdiff
path: root/jstests/replsets/initial_sync_oplog_visibility.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/replsets/initial_sync_oplog_visibility.js')
-rw-r--r--jstests/replsets/initial_sync_oplog_visibility.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/jstests/replsets/initial_sync_oplog_visibility.js b/jstests/replsets/initial_sync_oplog_visibility.js
index 9002a5f9b23..06eadc861b3 100644
--- a/jstests/replsets/initial_sync_oplog_visibility.js
+++ b/jstests/replsets/initial_sync_oplog_visibility.js
@@ -11,6 +11,8 @@
replTest.startSet();
replTest.initiate();
var primary = replTest.getPrimary();
+ assert.commandWorked(
+ primary.adminCommand({setParameter: 1, logComponentVerbosity: {query: 3}}));
var firstColl = "hangColl";
var secondColl = "secondColl";
@@ -48,5 +50,17 @@
awaitInsertShell();
replTest.awaitSecondaryNodes();
+ // The oplog visibility query should use an oplog-optimized plan. Check vaguely for this by
+ // awaiting a characteristic log message for each storage engine - we at least know that *some*
+ // query used the optimal plan around the time of the visibility query.
+ const timeoutSeconds = 30;
+ if (primary.adminCommand("serverStatus").storageEngine.name === "wiredTiger") {
+ jsTestLog("Checking for log message about 'direct oplog seek' query plan.");
+ checkLog.contains(primary, "Using direct oplog seek", timeoutSeconds);
+ } else if (primary.adminCommand("serverStatus").storageEngine.name === "mmapv1") {
+ jsTestLog("Checking for log message about 'Using OplogStart stage'.");
+ checkLog.contains(primary, "Using OplogStart stage", timeoutSeconds);
+ }
+
replTest.stopSet();
})(); \ No newline at end of file