diff options
-rw-r--r-- | jstests/replsets/oplog_replay_on_startup.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/jstests/replsets/oplog_replay_on_startup.js b/jstests/replsets/oplog_replay_on_startup.js index bac823ee3e5..c304986e79f 100644 --- a/jstests/replsets/oplog_replay_on_startup.js +++ b/jstests/replsets/oplog_replay_on_startup.js @@ -103,11 +103,17 @@ injectedOplogTruncateAfterPointDoc, "If the Timestamps differ, the server may be filling in the null timestamps"); - try { - conn = rst.restart(0); // Restart in replSet mode again. - } catch (e) { - assert.eq(expectedState, 'FATAL', 'node failed to restart: ' + e); + rst.stop(0); + + if (expectedState === 'FATAL') { + try { + rst.start(0, {waitForConnect: true}, true); + } catch (e) { + } + rst.stop(0, undefined, {allowedExitCode: MongoRunner.EXIT_ABRUPT}); return; + } else { + conn = rst.start(0, {waitForConnect: true}, true); } // Wait for the node to go to SECONDARY if it is able. |