cockroach
cockroach copied to clipboard
cli: `node status` output misaligns decommission status
BUG REPORT
Please describe the issue you observed:
cockroach node status will hide decommissioning or dead nodes, unless the user requests all nodes to be shown. The data shown is collected from two different RPC calls and these do not line up. For example, a node's liveness will be put together with a different node's decommission status.
This only affects 2.0 and earlier. In 2.1, the logic for cockroach node status was changed.
- What did you do?
- Decommission NodeID 1 in a cluster
- Run
cockroach node status --decommissionandcockroach node status - Observe the columns is_live compared to the others, e.g. updated_at. You will see it is wrong.
- What did you expect to see?
neeral@neeral-M51AC:~/go/src/github.com/cockroachdb/cockroach$ cockroach node status --insecure --port 10002
+----+--------------------+-------------------------+---------------------+---------------------+---------+
| id | address | build | updated_at | started_at | is_live |
+----+--------------------+-------------------------+---------------------+---------------------+---------+
| 2 | neeral-M51AC:10002 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:38:07 | 2018-07-20 16:30:32 | true |
| 3 | neeral-M51AC:10003 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:38:07 | 2018-07-20 16:30:34 | true |
| 4 | neeral-M51AC:10004 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:38:06 | 2018-07-20 16:36:56 | true |
+----+--------------------+-------------------------+---------------------+---------------------+---------+
(3 rows)
neeral@neeral-M51AC:~/go/src/github.com/cockroachdb/cockroach$ cockroach node status --insecure --port 10002 --all
+----+--------------------+-------------------------+---------------------+---------------------+---------+------------------+-----------------------+--------+--------------------+------------------------+------------+-----------+-------------+--------------+--------------+-------------------+--------------------+-------------+
| id | address | build | updated_at | started_at | is_live | replicas_leaders | replicas_leaseholders | ranges | ranges_unavailable | ranges_underreplicated | live_bytes | key_bytes | value_bytes | intent_bytes | system_bytes | gossiped_replicas | is_decommissioning | is_draining |
+----+--------------------+-------------------------+---------------------+---------------------+---------+------------------+-----------------------+--------+--------------------+------------------------+------------+-----------+-------------+--------------+--------------+-------------------+--------------------+-------------+
| 1 | neeral-M51AC:10001 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:37:56 | 2018-07-20 16:34:52 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | true | true |
| 2 | neeral-M51AC:10002 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:38:17 | 2018-07-20 16:30:32 | true | 11 | 11 | 20 | 0 | 0 | 4670684 | 54588 | 4664514 | 0 | 17045 | 21 | false | false |
| 3 | neeral-M51AC:10003 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:38:17 | 2018-07-20 16:30:34 | true | 6 | 6 | 20 | 0 | 0 | 4670684 | 54588 | 4664514 | 0 | 17045 | 21 | false | false |
| 4 | neeral-M51AC:10004 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:38:16 | 2018-07-20 16:36:56 | true | 3 | 2 | 20 | 0 | 0 | 4607768 | 54576 | 4601575 | 0 | 17045 | 21 | false | false |
+----+--------------------+-------------------------+---------------------+---------------------+---------+------------------+-----------------------+--------+--------------------+------------------------+------------+-----------+-------------+--------------+--------------+-------------------+--------------------+-------------+
(4 rows)
- What did you see instead?
neeral@neeral-M51AC:~/go/src/github.com/cockroachdb/cockroach$ cockroach node status --insecure --port 10002 --all
+----+--------------------+-------------------------+---------------------+---------------------+---------+------------------+-----------------------+--------+--------------------+------------------------+------------+-----------+-------------+--------------+--------------+-------------------+--------------------+-------------+
| id | address | build | updated_at | started_at | is_live | replicas_leaders | replicas_leaseholders | ranges | ranges_unavailable | ranges_underreplicated | live_bytes | key_bytes | value_bytes | intent_bytes | system_bytes | gossiped_replicas | is_decommissioning | is_draining |
+----+--------------------+-------------------------+---------------------+---------------------+---------+------------------+-----------------------+--------+--------------------+------------------------+------------+-----------+-------------+--------------+--------------+-------------------+--------------------+-------------+
| 1 | neeral-M51AC:10001 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:37:56 | 2018-07-20 16:34:52 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | true | true |
| 2 | neeral-M51AC:10002 | v2.0.4-4-gfb69397 | 2018-07-20 16:39:54 | 2018-07-20 16:39:54 | true | 0 | 0 | 20 | 0 | 0 | 4922350 | 54984 | 4916941 | 0 | 17033 | 21 | false | false |
| 3 | neeral-M51AC:10003 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:39:57 | 2018-07-20 16:30:34 | true | 14 | 13 | 20 | 0 | 0 | 5195505 | 55518 | 5190439 | 0 | 17059 | 21 | false | false |
| 4 | neeral-M51AC:10004 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:39:56 | 2018-07-20 16:36:56 | true | 5 | 4 | 20 | 0 | 20 | 5132062 | 55260 | 5127182 | 0 | 17059 | 21 | false | false |
+----+--------------------+-------------------------+---------------------+---------------------+---------+------------------+-----------------------+--------+--------------------+------------------------+------------+-----------+-------------+--------------+--------------+-------------------+--------------------+-------------+
(4 rows)
neeral@neeral-M51AC:~/go/src/github.com/cockroachdb/cockroach$ cockroach node status --insecure --port 10002
+----+--------------------+-------------------------+---------------------+---------------------+---------+
| id | address | build | updated_at | started_at | is_live |
+----+--------------------+-------------------------+---------------------+---------------------+---------+
| 2 | neeral-M51AC:10002 | v2.0.4-4-gfb69397 | 2018-07-20 16:39:54 | 2018-07-20 16:39:54 | false |
| 3 | neeral-M51AC:10003 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:39:57 | 2018-07-20 16:30:34 | true |
| 4 | neeral-M51AC:10004 | v2.0.4-5-g7fa050c-dirty | 2018-07-20 16:39:56 | 2018-07-20 16:36:56 | true |
+----+--------------------+-------------------------+---------------------+---------------------+---------+
Fixed by #27808