]> sourceware.org Git - lvm2.git/commitdiff
dmeventd: (workaround) fix mirror DSO to work with lvmetad
authorHeinz Mauelshagen <heinzm@redhat.com>
Thu, 9 Mar 2017 19:41:07 +0000 (20:41 +0100)
committerHeinz Mauelshagen <heinzm@redhat.com>
Thu, 9 Mar 2017 19:41:07 +0000 (20:41 +0100)
Automatic dmeventd repair of mirrors with active lvmetad configured
(mirror_image_fault_policy = "allocate") fails because the lvscan
run before the repair in the mirror DSO does not update the
lvmetad cache properly thus "lvconvert --repair ..." fails.

Need to scan the mirror LV before and after the repair
to have proper cache content after the repair finished.
The cache can't be relied on or the repair will fail.

Resolves: rhbz1380521

daemons/dmeventd/plugins/mirror/dmeventd_mirror.c

index 4ec348f5a35868d2de8b99edbb6c1c7b63ffd5e1..181b8398b102ca9bc9cf618c3dc2b88fd2e13088 100644 (file)
@@ -111,6 +111,9 @@ static int _remove_failed_devices(const char *cmd_lvscan, const char *cmd_lvconv
                return 0;
        }
 
+       if (!dmeventd_lvm2_run_with_lock(cmd_lvscan))
+               log_warn("WARNING: Re-scan of mirrored device %s failed.", device);
+
        log_info("Repair of mirrored device %s finished successfully.", device);
 
        return 1;
@@ -188,7 +191,7 @@ int register_device(const char *device,
                goto_bad;
 
        if (!dmeventd_lvm2_command(state->mem, state->cmd_lvconvert, sizeof(state->cmd_lvconvert),
-                                  "lvconvert --repair --use-policies", device))
+                                  "lvconvert --config global{use_lvmetad = 0}' --repair --use-policies", device))
                goto_bad;
 
        *user = state;
This page took 0.038673 seconds and 5 git commands to generate.