Bug 149236

Summary: cman_tool wait not waiting
Product: [Retired] Red Hat Cluster Suite Reporter: Adam "mantis" Manthei <amanthei>
Component: cmanAssignee: Christine Caulfield <ccaulfie>
Status: CLOSED CURRENTRELEASE QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: cluster-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-24 14:33:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 147828    

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
cman-1.0-0.pre23.1
cman-kernel-2.6.9-21.0


How reproducible:
always

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
done
Checking in main.c;
/cvs/cluster/cluster/cman/cman_tool/main.c,v  <--  main.c
new revision: 1.12.2.4; previous revision: 1.12.2.3
done