Bug 8122 - onnode does not work correctly for 'ok' or 'healthy'
onnode does not work correctly for 'ok' or 'healthy'
Status: RESOLVED FIXED
Product: CTDB 2.5.x or older
Classification: Unclassified
Component: ctdb
unspecified
All All
: P5 normal
: ---
Assigned To: Michael Adam
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-09 13:14 UTC by Luk Claes
Modified: 2016-08-13 09:38 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luk Claes 2011-05-09 13:14:21 UTC
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.
Comment 1 Martin Schwenke 2016-08-13 09:38:25 UTC
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