1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
LVM2 mirror repository https://sourceware.org/lvm2/
Go to file
David Teigland bf77f71711 lvmetad: add invalidation method
Add the ability to invalidate global or individual VG metadata.
The invalid state is returned to lvm commands along with the metadata.
This allows lvm commands to detect stale metadata from the cache and
reread the latest metadata from disk (in a subsequent patch.)

These changes do not change the protocol or compatibility between
lvm commands and lvmetad.

Global information
------------------

Global information refers to metadata that is not isolated
to a single VG , e.g. the list of vg names, or the list of pvs.

When an external system, e.g. a locking system, detects that global
information has been changed from another host (e.g. a new vg has been
created) it sends lvmetad the message: set_global_info: global_invalid=1.
lvmetad sets the global invalid flag to indicate that its cached data is
stale.

When lvm commands request information from lvmetad, lvmetad returns the
cached information, along with an additional top-level config node called
"global_invalid".  This new info tells the lvm command that the cached
information is stale.

When an lvm command sees global_invalid from lvmated, it knows it should
rescan devices and update lvmetad with the latest information.  When this
is complete, it sends lvmetad the message: set_global_info:
global_invalid=0, and lvmetad clears the global invalid flag.  Further lvm
commands will use the lvmetad cache until it is invalidated again.

The most common commands that cause global invalidation are vgcreate and
vgextend.  These are uncommon compared to commands that report global
information, e.g. vgs.  So, the percentage of lvmetad replies containing
global_invalid should be very small.

VG information
--------------

VG information refers to metadata that is isolated to a single VG,
e.g. an LV or the size of an LV.

When an external system determines that VG information has been changed
from another host (e.g. an lvcreate or lvresize), it sends lvmetad the
message: set_vg_info: uuid=X version=N.  X is the VG uuid, and N is the
latest VG seqno that was written.  lvmetad checks the seqno of its cached
VG, and if the version from the message is newer, it sets an invalid flag
for the cached VG.  The invalid flag, along with the newer seqno are saved
in a new vg_info struct.

When lvm commands request VG metadata from lvmetad, lvmetad includes the
invalid flag along with the VG metadata.  The lvm command checks for this
flag, and rereads the VG from disk if set.  The VG read from disk is sent
to lvmetad.  lvmetad sees that the seqno in the new version matches the
seqno from the last set_vg_info message, and clears the vg invalid flag.
Further lvm commands will use the VG metadata from lvmetad until it is
next invalidated.
2015-06-23 16:36:33 -05:00
autoconf autoconf: Update config.guess/sub to 2014-01-01. 2014-01-21 22:00:15 +00:00
conf example.conf.in: apply previous improvements to example.conf 2015-05-15 20:32:58 +02:00
daemons lvmetad: add invalidation method 2015-06-23 16:36:33 -05:00
doc lvmpolld: Add standalone polldaemon. 2015-05-09 00:59:18 +01:00
include makefiles: better clean 2015-05-18 12:45:42 +02:00
lib log: flush stdout before print to stderr 2015-06-19 16:33:20 +02:00
libdaemon libdaemon: move compare_config to lib 2015-06-17 13:07:52 -05:00
libdm libdm: add dm_tree_node_set_thin_pool_read_only 2015-06-18 15:15:39 +02:00
liblvm makefiles: better clean 2015-05-18 12:45:42 +02:00
man man vgchange lvchange: mention activation option s 2015-06-16 13:28:07 -05:00
nix nix: socat for f18, nc for f17 2015-05-14 15:01:01 +02:00
old-tests report: select: refactor: move str_list to libdm 2014-06-17 16:27:20 +02:00
po makefiles: disable po file targes 2015-05-14 14:19:40 +02:00
python python: Check for NULL value before constructing string property 2015-05-06 08:51:04 -05:00
report-generators add copyright notices to new files 2010-07-28 12:20:38 +00:00
reports [REPORT-GENERATORS] cut down stylsheet.css to what we actually use 2010-07-21 10:00:38 +00:00
scripts cleanup: avoid printing gcc warning 2015-06-23 11:06:02 +02:00
spec spec: new man page 2015-05-15 21:31:28 +02:00
test tests: use vgscan after enable_dev 2015-06-23 13:39:57 +02:00
tools lvm: move hyphen mangling code 2015-06-19 09:51:48 +02:00
udev makefiles: compile files on make 2014-04-18 16:38:49 +02:00
unit-tests cleanup: use DM_ARRAY_SIZE 2014-04-08 11:00:15 +02:00
.gitignore gitignore: Ignore files ending in ~ 2012-06-11 16:13:02 +01:00
acinclude.m4 configure: detect st_ctim 2015-03-18 13:42:24 +01:00
aclocal.m4 configure: LOCALEDIR needs evaluated value 2015-05-18 13:06:34 +02:00
configure configure: fix missing [ 2015-05-20 09:32:03 +02:00
configure.in configure: fix missing [ 2015-05-20 09:32:03 +02:00
COPYING Outline docs 2001-12-31 16:12:40 +00:00
COPYING.LIB Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
INSTALL quick review of docs 2008-11-04 17:49:22 +00:00
make.tmpl.in makefiles: use bash subshell 2015-05-20 09:33:51 +02:00
Makefile.in makefiles: use fullpath when in assign 2015-05-14 00:19:32 +02:00
README README: fix link to lvm-devel mailing list 2015-03-31 15:44:00 +02:00
VERSION post-release 2015-06-20 01:05:21 +01:00
VERSION_DM post-release 2015-06-20 01:05:21 +01:00
WHATS_NEW post-release 2015-06-20 01:05:21 +01:00
WHATS_NEW_DM post-release 2015-06-20 01:05:21 +01:00

This tree contains the LVM2 and device-mapper tools and libraries.

For more information about LVM2 read the changelog in the WHATS_NEW file.
Installation instructions are in INSTALL.

There is no warranty - see COPYING and COPYING.LIB.

Tarballs are available from:
  ftp://sources.redhat.com/pub/lvm2/

The source code is stored in git:
  http://git.fedorahosted.org/git/lvm2.git
  git clone git://git.fedorahosted.org/git/lvm2.git

Mailing list for general discussion related to LVM2:
  linux-lvm@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

Mailing lists for LVM2 development, patches and commits:
  lvm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/lvm-devel

  lvm2-commits@lists.fedorahosted.org (Read-only archive of commits)
  Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits

Mailing list for device-mapper development, including kernel patches
and multipath-tools:
  dm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel

The source code repository used until 7th June 2012 is accessible here:
  http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/?cvsroot=lvm2.