Bug 738567 - ccs --checkconf works improperly when used on cluster.conf file
Summary: ccs --checkconf works improperly when used on cluster.conf file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ricci
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Chris Feist
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 756082
TreeView+ depends on / blocked
 
Reported: 2011-09-15 08:08 UTC by Radek Steiger
Modified: 2012-06-20 14:13 UTC (History)
2 users (show)

Fixed In Version: ricci-0.16.2-48.el6
Doc Type: Bug Fix
Doc Text:
Cause: Using ccs --checkconf with the '-f' option for a local file Consequence: ccs doesn't go out on each of the nodes specified in the local cluster.conf file to verify it's the same file. Fix: ccs has been updated to check remote nodes when using local cluster.conf file Result: When checking local cluster.conf file with --checkconf ccs now checks remote nodes.
Clone Of:
Environment:
Last Closed: 2012-06-20 14:13:46 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0898 normal SHIPPED_LIVE ricci bug fix and enhancement update 2012-06-19 19:50:47 UTC

Description Radek Steiger 2011-09-15 08:08:06 UTC
Description of problem:

ccs --checkconf works fine when -h hostname is set, however it should be able to validate the node synchronisation if only -f filename is given (as noted in man pages). The result of a -f check however is always false regardless the real cluster sync status.

I believe this is due to the method comparing config file xml to the live config from ricci, where the file xml has the intendation set as is in the file itself, but the live xml from ricci has no intendation at all, therefore bare comparation of such string will always fail.

Here's how it looks when i changed the ccs python code to dump the xml:

<cluster config_version="56" name="mycluster">
	<fence_daemon/>
	<clusternodes>
		<clusternode name="z2" nodeid="1"/>
		<clusternode name="z4" nodeid="2"/>
	</clusternodes>
	<cman/>
	<fencedevices/>
	<rm>
		<failoverdomains/>
		<resources/>
	</rm>
</cluster>

<cluster config_version="56" name="mycluster">
<fence_daemon/>
<clusternodes>
<clusternode name="z2" nodeid="1"/>
<clusternode name="z4" nodeid="2"/>
</clusternodes>
<cman/>
<fencedevices/>
<rm>
<failoverdomains/>
<resources/>
</rm>
</cluster>

The first one is a xml variable and the second one is the xml2 variable from check_cluster_conf() function.



[root@z2 cluster]# ccs -h z2 --checkconf
All nodes in sync.
[root@z2 cluster]# ccs -f /etc/cluster/cluster.conf --checkconf
Node: z2 does not match
Node: z4 does not match


Version-Release number of selected component (if applicable):
ccs-0.16.2-41.el6


How reproducible:
Always


Steps to Reproduce:

1. create a multi-node cluster (two nodes is enough)
2. sync the configuration (ccs -h z2 --sync --activate)
3. run a checkconf against config file on any of the nodes (ccs -f /etc/cluster/cluster.conf --checkconf)

  
Actual results:

[root@z2 cluster]# ccs -h z2 --checkconf
All nodes in sync.
[root@z2 cluster]# ccs -f /etc/cluster/cluster.conf --checkconf
Node: z2 does not match
Node: z4 does not match


Expected results:

[root@z2 cluster]# ccs -h z2 --checkconf
All nodes in sync.
[root@z2 cluster]# ccs -f /etc/cluster/cluster.conf --checkconf
All nodes in sync.


Additional info:

[root@z2 sbin]# cat /etc/cluster/cluster.conf 
<?xml version="1.0"?>
<cluster config_version="51" name="mycluster">
	<fence_daemon/>
	<clusternodes>
		<clusternode name="z2" nodeid="1"/>
		<clusternode name="z4" nodeid="2"/>
	</clusternodes>
	<cman/>
	<fencedevices/>
	<rm>
		<failoverdomains/>
		<resources/>
	</rm>
</cluster>

Comment 2 Radek Steiger 2011-09-15 08:16:06 UTC
There are actually two ways how to solve this issue:

1) do not compare the node configurations to the given config file, but compare all of the nodes to the first node found in this config file instead


2) fix the intendation (which would possibly be the better way)

Comment 5 Chris Feist 2012-02-03 22:50:18 UTC
Before Fix:


[root@amoco-02 ~]# ccs -h localhost --checkconf
All nodes in sync.
[root@amoco-02 ~]# ccs -f /etc/cluster/cluster.conf --checkconf
Node: amoco-01.lab.msp.redhat.com does not match
Node: amoco-02.lab.msp.redhat.com does not match
[root@amoco-02 ~]# 


[root@amoco-02 ~]# ccs -f /etc/cluster/cluster.conf --checkconf
All nodes in sync.

Commit:
https://github.com/feist/ccs/commit/c56501b776b367ebc3cbae2452b0c33b75ca15a0

Comment 6 Chris Feist 2012-02-28 00:30:22 UTC
With ricci-0.16.2-48.el6

[root@ask-04 tmp]# ccs -h localhost --checkconf
All nodes in sync.
[root@ask-04 tmp]# ccs -f /etc/cluster/cluster.conf --checkconf
All nodes in sync.

Comment 8 Chris Feist 2012-03-15 20:04:01 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: Using ccs --checkconf with the '-f' option for a local file 

Consequence: ccs doesn't go out on each of the nodes specified in the local cluster.conf file to verify it's the same file.

Fix: ccs has been updated to check remote nodes when using local cluster.conf file

Result: When checking local cluster.conf file with --checkconf ccs now checks remote nodes.

Comment 10 errata-xmlrpc 2012-06-20 14:13:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0898.html


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