diff options
| author | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2019-12-23 16:55:35 +0000 |
|---|---|---|
| committer | evergreen <evergreen@mongodb.com> | 2019-12-23 16:55:35 +0000 |
| commit | 78992b6422979574cc8cea8145fd49561c8f1caf (patch) | |
| tree | 0c65e0d4c5331a098e3a2badd3b3c9acd0fcdb6b /jstests | |
| parent | ed728353a7922e0b8bee17612bd2db25a7557022 (diff) | |
| download | mongo-78992b6422979574cc8cea8145fd49561c8f1caf.tar.gz | |
SERVER-44061: Fix race between setting replication maintenance mode and concurrent election
(cherry picked from commit d3546ccb50f0137962f8185140281e7fd7323e4a)
Diffstat (limited to 'jstests')
| -rw-r--r-- | jstests/replsets/too_stale_secondary.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/jstests/replsets/too_stale_secondary.js b/jstests/replsets/too_stale_secondary.js index f75b86489aa..fb398b8c7e3 100644 --- a/jstests/replsets/too_stale_secondary.js +++ b/jstests/replsets/too_stale_secondary.js @@ -126,7 +126,13 @@ jsTestLog("7: Stop and restart Node 2."); replTest.stop(2); - replTest.restart(2); + replTest.restart(2, { + // Set the failpoint to fail the transition to maintenance mode once. Make sure + // transitioning to maintenance mode is resilient to errors (e.g. race with a concurrent + // election) and will eventually succeed. + setParameter: + {'failpoint.setMaintenanceModeFailsWithNotSecondary': tojson({mode: {times: 1}})} + }); jsTestLog( "8: Wait for Node 2 to transition to RECOVERING (its oplog should remain stale after restart)"); |
