Bug 823667 - Implement an on-demand dump of lvmetad state
Implement an on-demand dump of lvmetad state
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
6.4
Unspecified Unspecified
medium Severity low
: pre-dev-freeze
: ---
Assigned To: Petr Rockai
Cluster QE
: FutureFeature
Depends On:
Blocks: 817776
  Show dependency treegraph
 
Reported: 2012-05-21 16:06 EDT by Petr Rockai
Modified: 2013-02-21 03:10 EST (History)
12 users (show)

See Also:
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 03:10:06 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Rockai 2012-05-21 16:06:04 EDT
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 13:38:51 EDT
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 16:05:28 EDT
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 16:53:10 EDT
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 09:28:39 EST
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 03:10:06 EST
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.