Bug 149236 - cman_tool wait not waiting
Summary: cman_tool wait not waiting
Alias: None
Product: Red Hat Cluster Suite
Classification: Retired
Component: cman
Version: 4
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Christine Caulfield
QA Contact: Cluster QE
Depends On:
Blocks: 147828
TreeView+ depends on / blocked
Reported: 2005-02-21 15:59 UTC by Adam "mantis" Manthei
Modified: 2009-04-24 14:33 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2009-04-24 14:33:13 UTC

Attachments (Terms of Use)

Description Adam "mantis" Manthei 2005-02-21 15:59:39 UTC
Description of problem:
cman_tool wait and cman_tool -w join do not wait for the node to
become a cluster memeber before returning.  I don't know if the bug is
in cman_tool or the kernel module.  The code for cman_tool is as follows

static void cluster_wait(commandline_t *comline)
    while (!ioctl(cluster_sock, ioctl_code, 0))
            if (recv(cluster_sock, recvbuf, 
                                    sizeof(recvbuf), MSG_OOB) <= 0)
                    die("Error waiting for cluster\n");

the cman module has the following:
static int do_ioctl_get_members(unsigned long arg)
        if (!we_are_a_cluster_member)
                return -ENOENT;

From what I can tell, either cluster_wait() needs to be modified
to test that that the SIOCCLUSTER_GETMEMBERS isoctl is non negative,
or the ioctl needs to eliminate the check for we_are_a_cluster_member
upon startup.

Version-Release number of selected component (if applicable):
[root@trin-04 ~]# rpm -qa | grep cman

How reproducible:

Steps to Reproduce:
1. start with a a cluster were cman_tool join has not been called yet
2. start cman on a node: cman_tool join -w
3. cman_tool will have returned right away and /proc/cluster/status
   will indicate that the node is catually not yet part of the cluster
Actual results:
`cman_tool -w join` doesn't wait to be a cluster member

Expected results:
it should wait

Additional info:
The cman initscript needs the -w wait behavior fixed for bug #147828

Comment 1 Christine Caulfield 2005-02-21 17:11:14 UTC
bad idea to try to conflate the two events into one loop, it ended up
breaking both of then.

BTW I've also fixed cman_tool leave -w (spurious error message) too.

Checking in main.c;
/cvs/cluster/cluster/cman/cman_tool/main.c,v  <--  main.c
new revision: 1.17; previous revision: 1.16
Checking in main.c;
/cvs/cluster/cluster/cman/cman_tool/main.c,v  <--  main.c
new revision:; previous revision:

Note You need to log in before you can comment on or make changes to this bug.