Skip to contentSkip to conversation

stable-2.02 - dmeventd: avoid bail out preventing repair in raid plugin

PATCH Heinz Mauelshagen 1 participant 1 message Aug 16, 2019

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9e438b4bc6b9240b63fc79acfef3c77c01a848d8
Commit:        9e438b4bc6b9240b63fc79acfef3c77c01a848d8
Parent:        fdb014f02fe67d3a8455c919516e752ec07e9b04
Author:        Heinz Mauelshagen <[email protected]>
AuthorDate:    Fri Aug 16 16:25:08 2019 +0200
Committer:     Heinz Mauelshagen <[email protected]>
CommitterDate: Fri Aug 16 18:08:22 2019 +0200

dmeventd: avoid bail out preventing repair in raid plugin

Problem:
even though dead raid component devices are detected, the raid plugin is bailing out thus preventing a repair attempt.

Rational:
in case of component device errors, the MD resynchronization thread runs in parallel with the thrown event being processed by the raid plugin. The plugin retrieves the raid device status but that still reflects insync regions as 0 (when it should already be total regions) because the MD thread didn't update it yet.

Solution:
Remove the insync regions check and let lvconvert carry out its pre-repair checks and optionally carry out a repair attempt.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1560739
Related:  https://bugzilla.redhat.com/show_bug.cgi?id=1468590
Related:  https://bugzilla.redhat.com/show_bug.cgi?id=1654860
Related:  https://bugzilla.redhat.com/show_bug.cgi?id=1729303
Related:  https://bugzilla.redhat.com/show_bug.cgi?id=1741016
---
 daemons/dmeventd/plugins/raid/dmeventd_raid.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
daemons/dmeventd/plugins/raid/dmeventd_raid.c +6 -10
index 52cf43d..f435043 100644
@@ -76,16 +76,12 @@ static int _process_raid_event(struct dso_state *state, char *params, const char
 	}
 
 	if (dead) {
-		if (status->insync_regions < status->total_regions) {
-			if (!state->warned) {
-				state->warned = 1;
-				log_warn("WARNING: waiting for resynchronization to finish "
-					 "before initiating repair on RAID device %s.", device);
-			}
-
-			goto out; /* Not yet done syncing with accessible devices */
-		}
-
+		/*
+		 * Use the first event to run a repair ignoring any additonal ones.
+		 *
+		 * We presume lvconvert to do pre-repair
+		 * checks to avoid bloat in this plugin.
+		 */
 		if (state->failed)
 			goto out; /* already reported */