1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-12 13:18:31 +03:00
LVM2 mirror repository https://sourceware.org/lvm2/
Go to file
David Teigland 5d6bf1efb2 lvmetad: fix sync cache to lvmetad
error could be reproduced follow those steps:
    #!/bin/bash
    vgcreate vgtest /dev/sdb
    lvcreate -L 100M -n lv1 vgtest
    while :
    do
        service lvm2-lvmetad restart
        vgs &
        pvscan &
        lvcreate -L 100M -n lv2 vgtest &
        lvchange /dev/vgtest/lv1 --addtag xxxxx &
        wait
        if ! lvs|grep lv2;then
            echo "err create"
            break
        fi
        sleep 1
        lvremove -y /dev/vgtest/lv2
        lvchange /dev/vgtest/lv1 --deltag xxxxx
    done

and then fail to create vgtest/lv2, actually lv2 was created, while
the metadata written on disk is replaced by lvchange. It could look
up lv2 by calling dmsetup table, while lvs could not.

This is because, when lvmetad restarted, several lvm commands update
token concurrently, when lvcreate recieve "token_mismatch", it cancle
communicating with lvmetad, which leads to that lvmetad cache is not
sync with the metadata on disk, then lv2 is not committed to lvmetad
cache. The metadata of vgtest which lvchange query from lvmetad is
out of date. After lvchange, it use the old metadata cover the new one.

This patch let lvm process update token synchronously, only one command
update lvmetad token at a time.

lvmetad_pvscan_single send the metadata on a pv by sending "pv_found"
to lvmetad, while the metadata maybe out of date after waiting for the
chance to update lvmetad token. Call label_read to read metadata again.

Token mismatch may lead to problems, increase log level.

Signed-off-by: wangjufeng<wangjufeng@huawei.com>
2019-09-25 14:31:08 -05:00
autoconf autoconf: Fix py-compile permissions 2016-02-18 01:05:05 +00:00
base radix-tree: fix some bugs in remove_prefix and iterate 2018-05-30 14:21:27 +01:00
conf build: make generate 2019-03-22 11:01:04 +01:00
coverity coverity: model few more functions 2017-06-27 12:17:16 +02:00
daemons lvmetad: fix sync cache to lvmetad 2019-09-25 14:31:08 -05:00
device_mapper build: rename device-mapper to device_mapper 2018-05-12 18:18:23 +02:00
doc release note: typos 2018-05-24 12:32:16 +01:00
include configure: check for pselect 2019-04-10 13:24:41 +02:00
lib lvmetad: fix sync cache to lvmetad 2019-09-25 14:31:08 -05:00
libdaemon cov: check for socket_path being set 2019-06-25 17:33:25 +02:00
libdm cov: Fix memory leak 2019-08-28 14:47:23 +02:00
liblvm liblvm2app: add a couple tests 2018-05-17 15:55:44 -05:00
man build: make generate 2019-09-24 10:38:22 +02:00
nix lockd: Clean up spec 2015-07-04 14:36:57 +02:00
po doc: change fsf address 2016-01-21 12:11:37 +01:00
python python: specify libdm path for linking 2018-05-15 22:02:41 +02:00
scripts systemd: put back DefaultDependencies=no for lvmpolld and lvmetad socket unit 2019-04-11 12:25:45 +02:00
spec spec: Move blkdeactivate to device-mapper 2019-09-20 10:56:46 +02:00
test tests: allow-mixed-block-sizes skip with older losetup 2019-09-24 14:08:23 +02:00
tools vgcreate/vgextend: restrict PVs with mixed block sizes 2019-09-24 10:14:30 +02:00
udev udev: do not overwrite ID_MODEL in 69-dm-lvm-metad.rules 2019-07-04 13:06:44 +02:00
.gitignore gitignore 2018-05-23 16:53:18 +02:00
acinclude.m4 [build] uncomment 'serial 3' in an m4 file. 2018-04-30 09:44:27 +01:00
aclocal.m4 [lib/device/bcache] Tweaks after Kabi's review 2018-04-20 11:10:45 -05:00
configure configure: check for pselect 2019-04-10 13:24:41 +02:00
configure.ac configure: check for pselect 2019-04-10 13:24:41 +02:00
COPYING doc: change fsf address 2016-01-21 12:11:37 +01:00
COPYING.BSD Add BSD 2-Clause License 2018-07-27 17:09:03 +02: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 make: support comments in exported symbols 2019-08-07 15:27:25 +02:00
Makefile.in build: Fix make rpm with releases 2019-08-27 12:23:13 +02:00
README README: Include new github links 2017-09-13 20:20:04 +01:00
TESTING docs: Add TESTING file 2017-12-14 16:45:47 +01:00
VERSION post-release 2019-08-27 17:21:22 +02:00
VERSION_DM post-release 2019-08-27 17:21:22 +02:00
WHATS_NEW WHATS_NEW: vgcreate/vgextend logical block size 2019-09-24 10:51:50 +02:00
WHATS_NEW_DM post-release 2019-08-27 17:21:22 +02: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://sourceware.org/pub/lvm2/
  ftp://sources.redhat.com/pub/lvm2/
  https://github.com/lvmteam/lvm2/releases

The source code is stored in git:
  https://sourceware.org/git/?p=lvm2.git
  git clone git://sourceware.org/git/lvm2.git
mirrored to:
  https://github.com/lvmteam/lvm2
  git clone https://github.com/lvmteam/lvm2.git
  git clone git@github.com:lvmteam/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

Website:
  https://sourceware.org/lvm2/

Report upstream bugs at:
  https://bugzilla.redhat.com/enter_bug.cgi?product=LVM%20and%20device-mapper
or open issues at:
  https://github.com/lvmteam/lvm2/issues

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