Skip to content

Commit f80d164

Browse files
jmd-mongojeff-allen-mongo
authored andcommitted
DOCSP-20098 updates isBalancerRunning method output (#162)
* DOCSP-20098 updates isBalancerRunning method output * adds reference links for ok, clusterTime, and operationTime * adds links to new refs * updates ref links in source/includes/fact-runCommand-results.rst * updates sh.isBalancerRunning() description across reference pages * fixes spacing issue * provide more specific ref paths to prevent "Ambiguous target" errors * ref links * removes single quotes * each item desc references the section, rather than the individual fields * rephrases operationTime definition * cleans up include * removes extra whitespace
1 parent 1417c36 commit f80d164

File tree

5 files changed

+77
-13
lines changed

5 files changed

+77
-13
lines changed

source/includes/fact-runCommand-results.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
* - ``ok``
1313

14-
- A number that indicates whether the command has succeeded
15-
(``1``) or failed (``0``).
14+
- A number that indicates whether the command has succeeded (``1``)
15+
or failed (``0``).
1616

1717
* - ``operationTime``
1818

19-
- The logical time of the performed operation, represented in
20-
MongoDB by the timestamp from the oplog entry. *Only for replica
21-
sets and sharded clusters*
19+
- The logical time of the operation. MongoDB uses the logical time
20+
to order operations. *Only for replica sets and sharded
21+
clusters.*
2222

2323
If the command does not generate an oplog entry, e.g. a read
2424
operation, then the operation does not advance the logical

source/reference/method.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ Sharding
998998

999999
* - :method:`sh.isBalancerRunning()`
10001000

1001-
- Returns a boolean to report if the balancer process is currently migrating chunks.
1001+
- Returns a document describing the status of the balancer.
10021002

10031003
* - :method:`sh.moveChunk()`
10041004

source/reference/method/js-sharding.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Sharding Methods
9898

9999
* - :method:`sh.isBalancerRunning()`
100100

101-
- Returns a boolean to report if the balancer process is currently migrating chunks.
101+
- Returns a document describing the status of the balancer.
102102

103103
* - :method:`sh.moveChunk()`
104104

source/reference/method/sh.isBalancerRunning.txt

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,78 @@ sh.isBalancerRunning()
1010
:depth: 1
1111
:class: singlecol
1212

13+
Definition
14+
----------
15+
1316
.. method:: sh.isBalancerRunning()
1417

15-
:returns: boolean
18+
Returns a document describing the status of the balancer.
19+
20+
Output Document
21+
---------------
22+
23+
The following is an example of a document returned by the command:
24+
25+
.. code-block:: json
26+
:copyable: false
27+
28+
{
29+
mode: 'full',
30+
inBalancerRound: false,
31+
numBalancerRounds: Long("1143"),
32+
ok: 1,
33+
'$clusterTime': {
34+
clusterTime: Timestamp({ t: 1639753724, i: 3 }),
35+
signature: {
36+
hash: Binary(Buffer.from("0000000000000000000000000000000000000000", "hex"), 0),
37+
keyId: Long("0")
38+
}
39+
},
40+
operationTime: Timestamp({ t: 1639753724, i: 3 })
41+
}
42+
43+
.. list-table::
44+
:header-rows: 1
45+
:widths: 20 80
46+
47+
* - Field
48+
- Description
49+
50+
* - ``mode``
51+
52+
- String that specifies whether the balancer thread is running
53+
or stopped. Possible values are:
54+
55+
- "full"
56+
Balancer thread is running but not necessarily in a
57+
balancing round.
58+
59+
- "off"
60+
Balancer thread is stopped. Chunk balancing cannot occur in
61+
this mode.
62+
63+
* - ``inBalancerRound``
64+
65+
- Boolean that specifies if the balancer is currently in a
66+
balancing round.
67+
68+
* - ``numBalancerRounds``
69+
70+
- Number of balancer rounds which have occurred since the
71+
config servers were started. This value is reset to 0 when
72+
the config servers are restarted.
73+
74+
* - ``ok``
75+
76+
- See :ref:`Command Response <command-response>`.
77+
78+
* - ``$clusterTime``
79+
80+
- See :ref:`Command Response <command-response>`.
81+
82+
* - ``operationTime``
1683

17-
Returns true if the :term:`balancer` process is currently running
18-
and migrating chunks and false if the balancer process is not
19-
running. Use :method:`sh.getBalancerState()` to determine if the
20-
balancer is enabled or disabled.
84+
- See :ref:`Command Response <command-response>`.
2185

2286
.. seealso::
2387

source/reference/sharding.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Sharding Methods in ``mongosh``
9999

100100
* - :method:`sh.isBalancerRunning()`
101101

102-
- Returns a boolean to report if the balancer process is currently migrating chunks.
102+
- Returns a document describing the status of the balancer.
103103

104104
* - :method:`sh.moveChunk()`
105105

0 commit comments

Comments
 (0)