diff options
Diffstat (limited to 'jstests/sharding/txn_two_phase_commit_server_status.js')
-rw-r--r-- | jstests/sharding/txn_two_phase_commit_server_status.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/jstests/sharding/txn_two_phase_commit_server_status.js b/jstests/sharding/txn_two_phase_commit_server_status.js new file mode 100644 index 00000000000..7af87314fc1 --- /dev/null +++ b/jstests/sharding/txn_two_phase_commit_server_status.js @@ -0,0 +1,19 @@ +// Basic test that the two-phase commit coordinator metrics fields appear in serverStatus output. +(function() { + "use strict"; + + const st = new ShardingTest({shards: 1, config: 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.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(); +})(); |