From efaaf3146da35481375b700d6cba6eb32435e275 Mon Sep 17 00:00:00 2001 From: Jonathan Earl Brassow Date: Mon, 2 Aug 2010 19:03:45 +0000 Subject: [PATCH] Disallow mirrored logs in cluster mirrors. The cluster log daemon (cmirrord) is not multi-threaded and can handle only one request at a time. When a log is stacked on top of a mirror (which itself contains a 'core' log), it creates a situation that cannot be solved without threading. When the top level mirror issues a "resume", the log daemon attempts to read from the log device to retrieve the log state. However, the log is a mirror which, before issuing the read, attempts to determine the 'sync' status of the region of the mirror which is to be read. This sync status request cannot be completed by the daemon because it is blocked on a read I/O to the very mirror requesting the sync status. --- WHATS_NEW | 1 + lib/metadata/mirror.c | 19 +++++++++++++++---- tools/lvconvert.c | 9 +++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 122a0b33d..80361c9b4 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.73 - ================================ + Disallow 'mirrored' log type for cluster mirrors. Do not use VPATH in include/Makefile. Fix exported_symbols generation to use standard compiler arguments. Use #include <> not "" in lvm2app.h which gets installed on the system. diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index 8172c6d78..4f926e1bc 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -1970,10 +1970,21 @@ int lv_add_mirrors(struct cmd_context *cmd, struct logical_volume *lv, return 0; } - if (vg_is_clustered(lv->vg) && !(lv->status & ACTIVATE_EXCL) && - !cluster_mirror_is_available(lv)) { - log_error("Shared cluster mirrors are not available."); - return 0; + if (vg_is_clustered(lv->vg)) { + if (!(lv->status & ACTIVATE_EXCL) && + !cluster_mirror_is_available(lv)) { + log_error("Shared cluster mirrors are not available."); + return 0; + } + + /* + * No mirrored logs for cluster mirrors until + * log daemon is multi-threaded. + */ + if (log_count > 1) { + log_error("Log type, \"mirrored\", is unavailable to cluster mirrors"); + return 0; + } } /* For corelog mirror, activation code depends on diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 5dda2993e..9f90468dd 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -919,6 +919,15 @@ static int _lvconvert_mirrors_parse_params(struct cmd_context *cmd, return 0; } + /* + * No mirrored logs for cluster mirrors until + * log daemon is multi-threaded. + */ + if ((*new_log_count == 2) && vg_is_clustered(lv->vg)) { + log_error("Log type, \"mirrored\", is unavailable to cluster mirrors"); + return 0; + } + log_verbose("Setting logging type to %s", mirrorlog); /*