Bug 823667 - Implement an on-demand dump of lvmetad state
Summary: Implement an on-demand dump of lvmetad state
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.4
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: pre-dev-freeze
: ---
Assignee: Petr Rockai
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 817776
TreeView+ depends on / blocked
 
Reported: 2012-05-21 20:06 UTC by Petr Rockai
Modified: 2013-02-21 08:10 UTC (History)
12 users (show)

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.
Clone Of:
Environment:
Last Closed: 2013-02-21 08:10:06 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0501 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2013-02-20 21:30:45 UTC

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


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