summaryrefslogtreecommitdiff
path: root/jstests/replsets/libs
diff options
context:
space:
mode:
authorGregory Noma <gregory.noma@gmail.com>2021-09-30 16:00:29 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-30 21:01:46 +0000
commit96327c826416d360ee8bd6361b36cd5d96fc802d (patch)
tree94a7ef8555f8afa97b968d2b50c963749984a5df /jstests/replsets/libs
parent1d1dbcdd81a06960856ba48c6cb388235c0e9e29 (diff)
downloadmongo-96327c826416d360ee8bd6361b36cd5d96fc802d.tar.gz
SERVER-59058 Enforce fast count validation in ValidateCollections Python hook
Diffstat (limited to 'jstests/replsets/libs')
-rw-r--r--jstests/replsets/libs/initial_sync_test.js16
-rw-r--r--jstests/replsets/libs/rollback_test.js5
-rw-r--r--jstests/replsets/libs/rollback_test_deluxe.js6
3 files changed, 6 insertions, 21 deletions
diff --git a/jstests/replsets/libs/initial_sync_test.js b/jstests/replsets/libs/initial_sync_test.js
index 235fa279b16..1b7c711788b 100644
--- a/jstests/replsets/libs/initial_sync_test.js
+++ b/jstests/replsets/libs/initial_sync_test.js
@@ -126,17 +126,13 @@ function InitialSyncTest(
return isNodeInState(secondary, ReplSetTest.State.SECONDARY);
}
- function checkDataConsistency() {
- const name = replSet.name;
-
- // Make sure there are no open transactions.
- let status = assert.commandWorked(primary.adminCommand('serverStatus'));
+ /**
+ * Asserts that there are no open transactions.
+ */
+ function assertNoOpenTxns() {
+ const status = assert.commandWorked(primary.adminCommand('serverStatus'));
assert(typeof status.transactions === "object", status);
assert.eq(0, status.transactions.currentOpen, status.transactions);
-
- // We must check counts before validate is called during stopSet since validate fixes
- // counts.
- replSet.checkCollectionCounts(name);
}
/**
@@ -287,7 +283,7 @@ function InitialSyncTest(
*/
this.stop = function() {
transitionIfAllowed(State.kStopped);
- checkDataConsistency();
+ assertNoOpenTxns();
return replSet.stopSet();
};
}
diff --git a/jstests/replsets/libs/rollback_test.js b/jstests/replsets/libs/rollback_test.js
index 04eea18066c..5e70cd96614 100644
--- a/jstests/replsets/libs/rollback_test.js
+++ b/jstests/replsets/libs/rollback_test.js
@@ -250,11 +250,6 @@ function RollbackTest(name = "RollbackTest", replSet) {
rst.nodes.forEach(TwoPhaseDropCollectionTest.waitForAllCollectionDropsToComplete);
const name = rst.name;
- // We must check counts before we validate since validate fixes counts. We cannot check
- // counts if unclean shutdowns occur.
- if (!TestData.allowUncleanShutdowns || !TestData.rollbackShutdowns) {
- rst.checkCollectionCounts(name);
- }
rst.checkOplogs(name);
rst.checkReplicatedDataHashes(name);
collectionValidator.validateNodes(rst.nodeList());
diff --git a/jstests/replsets/libs/rollback_test_deluxe.js b/jstests/replsets/libs/rollback_test_deluxe.js
index 29f1749b473..2c9382e9908 100644
--- a/jstests/replsets/libs/rollback_test_deluxe.js
+++ b/jstests/replsets/libs/rollback_test_deluxe.js
@@ -225,12 +225,6 @@ function RollbackTestDeluxe(name = "FiveNodeDoubleRollbackTest", replSet) {
});
const name = rst.name;
- // Check collection counts except when unclean shutdowns are allowed, as such a shutdown is
- // not guaranteed to preserve accurate collection counts. This count check must occur before
- // collection validation as the validate command will fix incorrect counts.
- if (!TestData.allowUncleanShutdowns || !TestData.rollbackShutdowns) {
- rst.checkCollectionCounts(name);
- }
rst.checkOplogs(name);
rst.checkReplicatedDataHashes(name);
collectionValidator.validateNodes(rst.nodeList());