blob: f40cb38a64a718abebd135a09d3dea5e4067cb8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
/**
* Tests that sharding state is properly initialized on shard members that undergo startup recovery.
*
* We control our own failovers, and we also need the RSM to react reasonably quickly to those.
* @tags: [requires_persistence, does_not_support_stepdowns, requires_streamable_rsm]
*/
(function() {
"use strict";
load("jstests/sharding/libs/sharding_state_test.js");
const st = new ShardingTest({config: 1, shards: {rs0: {nodes: 1}}});
const rs = st.rs0;
let primary = rs.getPrimary();
primary = ShardingStateTest.putNodeInStartupRecovery({replSet: rs, node: primary});
jsTestLog("Ensuring node is up as a primary and checking sharding state");
ShardingStateTest.failoverToMember(rs, primary);
ShardingStateTest.checkShardingState(st);
st.stop();
})();
|