summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2019-01-25 18:01:12 -0500
committerTess Avitabile <tess.avitabile@mongodb.com>2019-01-29 13:12:04 -0500
commitb4ee2a119c65d1f2a0cb2288c1242fbf4f74a543 (patch)
tree241e9ad82c34f31db3b6b02eed3405001d5d0af5
parentda3c2c2dfcf0fc680a4f49f8f29ab0671f345d61 (diff)
downloadmongo-b4ee2a119c65d1f2a0cb2288c1242fbf4f74a543.tar.gz
SERVER-39212 waitForSecondaries in background dbhash check must wait for lastApplied to reach clusterTime when enableMajorityReadConcern=false
-rw-r--r--jstests/hooks/run_check_repl_dbhash_background.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/jstests/hooks/run_check_repl_dbhash_background.js b/jstests/hooks/run_check_repl_dbhash_background.js
index b0874c43ae8..8e5b942a2eb 100644
--- a/jstests/hooks/run_check_repl_dbhash_background.js
+++ b/jstests/hooks/run_check_repl_dbhash_background.js
@@ -167,20 +167,24 @@
});
} else {
// If majority reads are not supported, then our only option is to poll for the
- // lastOpCommitted on the secondary to catch up.
+ // appliedOpTime on the secondary to catch up.
assert.soon(
function() {
const rsStatus =
assert.commandWorked(db.adminCommand({replSetGetStatus: 1}));
- const committedOpTime = rsStatus.optimes.lastCommittedOpTime;
- if (bsonWoCompare(committedOpTime.ts, clusterTime) >= 0) {
+
+ // The 'atClusterTime' waits for the appliedOpTime to advance to
+ // 'clusterTime'.
+ const appliedOpTime = rsStatus.optimes.appliedOpTime;
+ if (bsonWoCompare(appliedOpTime.ts, clusterTime) >= 0) {
debugInfo.push({
"node": db.getMongo(),
"session": session,
- "committedOpTime": committedOpTime.ts
+ "appliedOpTime": appliedOpTime.ts
});
}
- return bsonWoCompare(committedOpTime.ts, clusterTime) >= 0;
+
+ return bsonWoCompare(appliedOpTime.ts, clusterTime) >= 0;
},
"The majority commit point on secondary " + i + " failed to reach " +
clusterTime,