summaryrefslogtreecommitdiff
path: root/jstests/replsets/tenant_migration_concurrent_migrations_stress_test.js
diff options
context:
space:
mode:
authorAndrew Shuvalov <andrew.shuvalov@mongodb.com>2021-09-03 14:01:19 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-03 14:24:05 +0000
commit44f3fd8767c61ab534b341a7f695f051bd167a52 (patch)
tree56980e10fe0c4ad2221cae5dfc3aa6359190fbcf /jstests/replsets/tenant_migration_concurrent_migrations_stress_test.js
parent46ec8fbe159742162b25ea22e8aec576d9c4c322 (diff)
downloadmongo-44f3fd8767c61ab534b341a7f695f051bd167a52.tar.gz
SERVER-59655 better logging in the tenant_migration_concurrent_migrations_stress_test.js test
Diffstat (limited to 'jstests/replsets/tenant_migration_concurrent_migrations_stress_test.js')
-rw-r--r--jstests/replsets/tenant_migration_concurrent_migrations_stress_test.js27
1 files changed, 22 insertions, 5 deletions
diff --git a/jstests/replsets/tenant_migration_concurrent_migrations_stress_test.js b/jstests/replsets/tenant_migration_concurrent_migrations_stress_test.js
index f5abadc021e..34eb0ad8c20 100644
--- a/jstests/replsets/tenant_migration_concurrent_migrations_stress_test.js
+++ b/jstests/replsets/tenant_migration_concurrent_migrations_stress_test.js
@@ -87,6 +87,7 @@ while (setOfCompleteMigrations.size < kMigrationsCount) {
}
sleep(100); // Do not query too often in any case.
+ let migrationsByState = {}; // Map of sets: key is state, value is set of IDs.
assert.soon(function() {
let currentOp = tenantMigrationTest.getDonorPrimary().adminCommand(
{currentOp: true, desc: "tenant donor migration"});
@@ -94,12 +95,14 @@ while (setOfCompleteMigrations.size < kMigrationsCount) {
return false;
}
currentOp.inprog.forEach((op) => {
+ let idPatternFound = op.tenantId.match(regexId);
+ assert(idPatternFound !== null);
+ assert.eq(idPatternFound.length, 2);
+ let id = parseInt(idPatternFound[1]);
+ assert(!isNaN(id));
+ assert(id >= 0, `${id}`);
+
if (op.lastDurableState === migrationStates.kCommitted) {
- let found = op.tenantId.match(regexId);
- assert(found !== null);
- assert.eq(found.length, 2);
- let id = parseInt(found[1]);
- assert(id >= 0, `${id}`);
assert(id <= kMigrationsCount, `${id}`);
// Check if this migration completed after previous check.
if (!setOfCompleteMigrations.has(id)) {
@@ -107,12 +110,26 @@ while (setOfCompleteMigrations.size < kMigrationsCount) {
--runningMigrations;
}
}
+
+ if (!(op.lastDurableState in migrationsByState)) {
+ migrationsByState[op.lastDurableState] = new Set();
+ }
+ let idsForState = migrationsByState[op.lastDurableState];
+ idsForState.add(id);
});
return true;
});
jsTestLog("Currently running " + runningMigrations + ", complete count " +
setOfCompleteMigrations.size);
+
+ for (let state in migrationsByState) {
+ let ids = migrationsByState[state];
+ if (ids.size > 0 && ids.size <= 10) {
+ // We only log the small collections to know which ones were stuck.
+ jsTestLog(`Migrations in state ${state}: ${tojson(new Array(...ids).join(' '))}`);
+ }
+ }
}
// Wait and forget all migrations.