In a 2 node samba ctdb cluster, running `ctdb nodestatus` incorrectly displays the status for all nodes as follows: # ctdb nodestatus Number of nodes:2 pnn:0 192.168.122.149 OK (THIS NODE) pnn:1 192.168.122.213 OK # echo $? 0 As per man page for ctdb(1), by default intention of `ctdb nodestatus` command is to display the status of current node and exit with corresponding exit code. . . . ctdb nodestatus defaults to providing status for only the current node. If PNN-LIST is provided then status is given for the indicated node(s). . . . Following that the exit code returned now also reflects the status of other nodes i.e, running `ctdb nodestatus` with a node in stopped state(using `ctdb stop`) results in the following output: # ctdb nodestatus Number of nodes:2 pnn:0 192.168.122.149 OK (THIS NODE) pnn:1 192.168.122.213 STOPPED|INACTIVE # echo $? 32 Additional info: I can confirm that with v4.4.6, everything was working fine as expected.
Will add fix and some tests
Doesn't match documentation
Created attachment 13232 [details] Draft fix and tests for master
Attached patch contains: 8fc36696f7e ctdb-tools: Stop "ctdb nodestatus" from always showing all nodes fb7aad28f84 ctdb-tools: "ctdb nodestatus" should only display header for "all" 6909f76813e ctdb-tests: Add some extra tests for "ctdb nodestatus" If I apply only the test commit then the last 3 (of 4 new tests) fail: PASSED ./ctdb/tests/tool/ctdb.nodestatus.001.sh PASSED ./ctdb/tests/tool/ctdb.nodestatus.002.sh PASSED ./ctdb/tests/tool/ctdb.nodestatus.003.sh *FAILED* ./ctdb/tests/tool/ctdb.nodestatus.004.sh *FAILED* ./ctdb/tests/tool/ctdb.nodestatus.005.sh *FAILED* ./ctdb/tests/tool/ctdb.nodestatus.006.sh 3/6 tests passed With the fixes applied: PASSED ./ctdb/tests/tool/ctdb.nodestatus.001.sh PASSED ./ctdb/tests/tool/ctdb.nodestatus.002.sh PASSED ./ctdb/tests/tool/ctdb.nodestatus.003.sh PASSED ./ctdb/tests/tool/ctdb.nodestatus.004.sh PASSED ./ctdb/tests/tool/ctdb.nodestatus.005.sh PASSED ./ctdb/tests/tool/ctdb.nodestatus.006.sh 6/6 tests passed
Attached patch is for master but applies cleanly to v4-5-test.
Created attachment 13237 [details] Patches for v4-5, v4-6
Hi Karolin, This is ready for 4.5 and 4.6. Thanks...
(In reply to Martin Schwenke from comment #7) Pushed to autobuild-v4-{6,5}-test.
(In reply to Karolin Seeger from comment #8) Pushed to both branches. Closing out bug report. Thanks!