summaryrefslogtreecommitdiff
path: root/jstests/sharding/txn_two_phase_commit_server_status.js
blob: fe1d64a57fa294415466ad83406c5356d9f9b197 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Basic test that the two-phase commit coordinator metrics fields appear in serverStatus output.
(function() {
"use strict";

const st = new ShardingTest({shards: 1});

const res = assert.commandWorked(st.shard0.adminCommand({serverStatus: 1}));
assert.neq(null, res.twoPhaseCommitCoordinator);
assert.eq(0, res.twoPhaseCommitCoordinator.totalCreated);
assert.eq(0, res.twoPhaseCommitCoordinator.totalStartedTwoPhaseCommit);
assert.eq(0, res.twoPhaseCommitCoordinator.totalCommittedTwoPhaseCommit);
assert.eq(0, res.twoPhaseCommitCoordinator.totalAbortedTwoPhaseCommit);
assert.neq(null, res.twoPhaseCommitCoordinator.currentInSteps);
assert.eq(0, res.twoPhaseCommitCoordinator.currentInSteps.writingParticipantList);
assert.eq(0, res.twoPhaseCommitCoordinator.currentInSteps.waitingForVotes);
assert.eq(0, res.twoPhaseCommitCoordinator.currentInSteps.writingDecision);
assert.eq(0, res.twoPhaseCommitCoordinator.currentInSteps.waitingForDecisionAcks);
assert.eq(0, res.twoPhaseCommitCoordinator.currentInSteps.deletingCoordinatorDoc);

st.stop();
})();