Files
mongo/jstests/sharding/txn_two_phase_commit_server_status.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
1.1 KiB
JavaScript
Raw Normal View History

// Basic test that the two-phase commit coordinator metrics fields appear in serverStatus output.
import {ShardingTest} from "jstests/libs/shardingtest.js";
const st = new ShardingTest({shards: 1});
const res = assert.commandWorked(st.shard0.adminCommand({serverStatus: 1}));
assert.neq(null, res.twoPhaseCommitCoordinator);
assert.hasFields(res.twoPhaseCommitCoordinator, ["totalCreated"]);
assert.hasFields(res.twoPhaseCommitCoordinator, ["totalStartedTwoPhaseCommit"]);
assert.hasFields(res.twoPhaseCommitCoordinator, ["totalCommittedTwoPhaseCommit"]);
assert.hasFields(res.twoPhaseCommitCoordinator, ["totalAbortedTwoPhaseCommit"]);
assert.neq(null, res.twoPhaseCommitCoordinator.currentInSteps);
assert.hasFields(res.twoPhaseCommitCoordinator.currentInSteps, ["writingParticipantList"]);
assert.hasFields(res.twoPhaseCommitCoordinator.currentInSteps, ["waitingForVotes"]);
assert.hasFields(res.twoPhaseCommitCoordinator.currentInSteps, ["writingDecision"]);
assert.hasFields(res.twoPhaseCommitCoordinator.currentInSteps, ["waitingForDecisionAcks"]);
assert.hasFields(res.twoPhaseCommitCoordinator.currentInSteps, ["deletingCoordinatorDoc"]);
st.stop();