Bug 823667

Summary: Implement an on-demand dump of lvmetad state
Product: Red Hat Enterprise Linux 6 Reporter: Petr Rockai <prockai>
Component: lvm2Assignee: Petr Rockai <prockai>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: low Docs Contact:
Priority: medium    
Version: 6.4CC: agk, cmarthal, dwysocha, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, syeghiay, thornber, zkabelac
Target Milestone: pre-dev-freezeKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.98-1.el6 Doc Type: Enhancement
Doc Text:
The lvmdump command has been extended to include a dump of internal lvmetad state, helping with troubleshooting and analysis of lvmetad-related problems.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 08:10:06 UTC Type: Bug
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: 817776    

Description Petr Rockai 2012-05-21 20:06:04 UTC
Probably achieved by a special client through a regular socket request (possibly a special request, not manual enumeration+iteration, to avoid inconsistent dumps). The state is embodied by the various hash tables in lvmetad_state, and their content is easily serialised using existing functionality in the daemon.

We want to call this in lvmdump to help with troubleshooting.

Comment 6 Petr Rockai 2012-08-17 17:38:51 UTC
The idea is to have lvmdump provide info about the state of running lvmetad. This means the lvmdump tarball will contain a file (lvmetad.txt, or else, an exact name will be specified) which contains the state of the running lvmetad (i.e. a snapshot of each VG's metadata and of device states at the moment of lvmetad). The way to verify this would be probably to check content of lvmetad.txt against the "normal" metadata dumps, although they are not going to match entirely. Probably a comparison of some of the more important values.

Either way, upstream tests will cover this functionality.

Comment 9 Petr Rockai 2012-10-11 20:05:28 UTC
The server side of this is implemented in a63b46bf36b22b83ff05f2d3529bc22a38ff56d3. We still need to adjust lvmdump.sh. I suggest the following code:

lvmetad_talk() {
    if type -p socat >& /dev/null; then
	socat "unix-connect:$1" -
    elif echo | nc -U "$1"; then
	nc -U "$1"
    else
	echo "WARNING: Neither socat nor nc -U seems to be available." 1>&2
	echo "# DUMP FAILED"
	return 1
    fi
}

lvmetad_dump() {
    (echo 'request="dump"'; echo '##') | lvmetad_talk "$@"
}

(The same is used in lvmetad-dump.sh in the upstream test suite.)

Comment 10 Petr Rockai 2012-10-11 20:53:10 UTC
Implemented the client side (lvmdump changes) in 4022fd3e79099fb22b2b7d3d6dca8de733a2a783. Running lvmdump -l should now include lvmetad.txt in the tarball, with a full dump of lvmetad state.

Comment 12 Nenad Peric 2012-11-16 14:28:39 UTC
Running the command lvmdump -l does create a lvmetad.txt file, which upon a cursosry check/comparison with backed up metadada looks OK. 

Marking it verified after basic testing/check based on Comment #6

tested on:

lvm2-2.02.98-3.el6
device-mapper-1.02.77-3.el6
kernel-2.6.32-339.el6

Comment 13 errata-xmlrpc 2013-02-21 08:10:06 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-2013-0501.html