diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2019-01-25 18:01:12 -0500 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2019-01-29 13:12:04 -0500 |
commit | b4ee2a119c65d1f2a0cb2288c1242fbf4f74a543 (patch) | |
tree | 241e9ad82c34f31db3b6b02eed3405001d5d0af5 /jstests | |
parent | da3c2c2dfcf0fc680a4f49f8f29ab0671f345d61 (diff) | |
download | mongo-b4ee2a119c65d1f2a0cb2288c1242fbf4f74a543.tar.gz |
SERVER-39212 waitForSecondaries in background dbhash check must wait for lastApplied to reach clusterTime when enableMajorityReadConcern=false
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/hooks/run_check_repl_dbhash_background.js | 14 |
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, |