During Michael's tutorial today we noticed that onnode ok nor onnode healthy seems to work. For instance 'onnode ok hostname' gave the same result for the number of hosts that were ok.
Fixed by the following CTDB commit back in 2013. Even noted the bug was fixed... but never closed the bug... commit 01a46205c3a3d6609dc0b0324319b89667dffa32 Author: Martin Schwenke <martin@meltin.net> Date: Thu Oct 24 14:15:53 2013 +1100 tools/onnode: Fix healthy/ok node handling This bit-rotted a long time ago when the "ThisNode" column was added to "ctdb -Y status" output. The fake "ctdb -Y status" output in the test was never updated to reflect this change. Instead of making sure that all columns are "0", just check that they're not "1". This implicitly ignores "Y" and "N" in this "ThisNode" column without having to do anything else clever. Also update associated tests. The main "ctdb ok" test had a duplicate opening line for a here document, which was tickled by this change. This fixes samba bz#8122. Signed-off-by: Martin Schwenke <martin@meltin.net> [root@m1n1 ~]# onnode ok hostname >> NODE: 10.0.0.30 << m1n1.lindom.example.local >> NODE: 10.0.0.31 << m1n2.lindom.example.local >> NODE: 10.0.0.32 << m1n3.lindom.example.local [root@m1n1 ~]# ctdb disable -n 2 [root@m1n1 ~]# onnode ok hostname >> NODE: 10.0.0.30 << m1n1.lindom.example.local >> NODE: 10.0.0.31 << m1n2.lindom.example.local [root@m1n1 ~]# ctdb enable -n 2 [root@m1n1 ~]# onnode healthy hostname >> NODE: 10.0.0.30 << m1n1.lindom.example.local >> NODE: 10.0.0.31 << m1n2.lindom.example.local >> NODE: 10.0.0.32 << m1n3.lindom.example.local [root@m1n1 ~]# ctdb disable -n 2 [root@m1n1 ~]# onnode healthy hostname >> NODE: 10.0.0.30 << m1n1.lindom.example.local >> NODE: 10.0.0.31 << m1n2.lindom.example.local