diff options
Diffstat (limited to 'jstests/replsets/initial_sync_nodes_maintain_and_gossip_commit_point.js')
| -rw-r--r-- | jstests/replsets/initial_sync_nodes_maintain_and_gossip_commit_point.js | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/jstests/replsets/initial_sync_nodes_maintain_and_gossip_commit_point.js b/jstests/replsets/initial_sync_nodes_maintain_and_gossip_commit_point.js index b3e596d1f0d..9b79b672611 100644 --- a/jstests/replsets/initial_sync_nodes_maintain_and_gossip_commit_point.js +++ b/jstests/replsets/initial_sync_nodes_maintain_and_gossip_commit_point.js @@ -118,21 +118,15 @@ assert.eq(1, rs.compareOpTimes(thirdCommitPointSecondary, secondCommitPointSecon hangBeforeCompletingOplogFetching.off(); hangBeforeFinish.wait(); -// Verify that the initial sync node receives the commit point from the primary, either via oplog -// fetching or by a heartbeat. This will usually happen via oplog fetching but in some cases it is -// possible that the OplogFetcher shuts down before this ever happens. See SERVER-76695 for details. +// Verify that the initial sync node receives the commit point from the primary via oplog fetching. // We only assert that it is greater than or equal to the second commit point because it is possible // for the commit point to not yet be advanced by the primary when we fetch the oplog entry. -assert.soon(() => { - const commitPointInitialSyncNode = getLastCommittedOpTime(initialSyncNode); - // compareOpTimes will throw an error if given an invalid opTime, and if the - // node has not yet advanced its opTime it will still have the default one, - // which is invalid. - if (!rs.isValidOpTime(commitPointInitialSyncNode)) { - return false; - } - return rs.compareOpTimes(commitPointInitialSyncNode, secondCommitPointPrimary) >= 0; -}, `commit point on initial sync node should be at least as up-to-date as the second commit point`); +const commitPointInitialSyncNode = getLastCommittedOpTime(initialSyncNode); +assert.gte( + rs.compareOpTimes(commitPointInitialSyncNode, secondCommitPointPrimary), + 0, + `commit point on initial sync node should be at least as up-to-date as the second commit point: ${ + tojson(commitPointInitialSyncNode)}`); // Verify that the non-voting secondary has received the updated commit point via heartbeats from // the initial sync node. |
