summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2016-09-16 02:11:58 +0100
committerAlasdair G Kergon <agk@redhat.com>2016-09-16 02:11:58 +0100
commit9c8c8fb63abd1a36b9c448450c9cccfac4c0299e (patch)
treebda3db2f046a3c12dca513f1b02559de3ca88569
parent5da35d879ad073d9fb0d7ec8bfabe9ae39ac5bc1 (diff)
downloadlvm2-9c8c8fb63abd1a36b9c448450c9cccfac4c0299e.tar.gz
alloc: Use --alloc normal for mirror logs.
The existing code doesn't understand that mirror logs should cling to parallel LVs (like extending them) instead of avoiding them. As a quick workaround to avoid lvcreate failures, hard-code --alloc normal for mirror logs even if the rest of the allocation used a stricter policy. https://bugzilla.redhat.com/show_bug.cgi?id=1376532
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/metadata/lv_manip.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 1ef3dc668..9c6ba3bca 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.166 -
=====================================
+ Use --alloc normal for mirror logs even if the mimages were stricter.
Use O_DIRECT to gather metadata in lvmdump.
Fix possible NULL pointer derefence when checking for monitoring.
Add lvmreport(7) man page.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index dcc8d860f..d6869e18c 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -3085,6 +3085,15 @@ static int _allocate(struct alloc_handle *ah,
if (!_find_max_parallel_space_for_one_policy(ah, &alloc_parms, pvms, &alloc_state))
goto_out;
+ /* As a workaround, if only the log is missing now, fall through and try later policies up to normal. */
+ /* FIXME Change the core algorithm so the log extents cling to parallel LVs instead of avoiding them. */
+ if (alloc_state.allocated == ah->new_extents &&
+ alloc_state.log_area_count_still_needed &&
+ ah->alloc < ALLOC_NORMAL) {
+ ah->alloc = ALLOC_NORMAL;
+ continue;
+ }
+
if ((alloc_state.allocated == ah->new_extents &&
!alloc_state.log_area_count_still_needed) ||
(!can_split && (alloc_state.allocated != old_allocated)))