diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2022-09-07 14:23:22 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-15 19:50:40 +0000 |
commit | ff2fffdf496ac1bc039cd8c84024cc6159cf80b6 (patch) | |
tree | ba11c4a785f01c2c8692ba234e4745347fa25373 /jstests/replsets | |
parent | 84f7412daaf4c44c4fd325230076101e0d95c05f (diff) | |
download | mongo-ff2fffdf496ac1bc039cd8c84024cc6159cf80b6.tar.gz |
SERVER-69001: Have initial sync persist its last oplog time into the minvalid document.
Diffstat (limited to 'jstests/replsets')
-rw-r--r-- | jstests/replsets/initial_sync1.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/jstests/replsets/initial_sync1.js b/jstests/replsets/initial_sync1.js index d66f960e132..98cc5d0e1e1 100644 --- a/jstests/replsets/initial_sync1.js +++ b/jstests/replsets/initial_sync1.js @@ -53,8 +53,13 @@ admin_s1.runCommand({replSetFreeze: 999999}); print("6. Bring up #3"); var hostname = getHostName(); -var secondary2 = - MongoRunner.runMongod(Object.merge({replSet: basename, oplogSize: 2}, x509_options2)); +var secondary2 = MongoRunner.runMongod(Object.merge({ + replSet: basename, + oplogSize: 2, + // Preserve the initial sync state to validate an assertion. + setParameter: {"failpoint.skipClearInitialSyncState": tojson({mode: 'alwaysOn'})} +}, + x509_options2)); var local_s2 = secondary2.getDB("local"); var admin_s2 = secondary2.getDB("admin"); @@ -108,5 +113,11 @@ assert.commandWorked(bulk.execute()); print("11. Everyone happy eventually"); replTest.awaitReplication(); +// SERVER-69001: Assert that the last oplog for initial sync was persisted in the minvalid document. +let syncingNodeMinvalid = secondary2.getDB("local").replset.minvalid.findOne()["ts"]; +let lastInitialSyncOp = + secondary2.adminCommand("replSetGetStatus")["initialSyncStatus"]["initialSyncOplogEnd"]; +assert.eq(lastInitialSyncOp, syncingNodeMinvalid); + MongoRunner.stopMongod(secondary2); replTest.stopSet(); |