All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takahiro Yasui <tyasui@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] handle transient errors in lvconvert --repair
Date: Wed, 19 May 2010 13:15:02 -0400	[thread overview]
Message-ID: <4BF41C96.4090702@redhat.com> (raw)
In-Reply-To: <4BF41557.3040708@redhat.com>

Hi Peter,

>>> +	if (failed_mirrors) {
>>> +		if (!lv_remove_mirrors(cmd, lv, failed_mirrors, new_log_count,
>>> +				       _is_partial_lv, NULL, 0))

+        if (failed_mirrors || failed_log) {
+                if (!lv_remove_mirrors(cmd, lv, failed_mirrors, failed_log,
+                                       _is_partial_lv, NULL, 0)) {

My test cases passed with this modification.

Thanks,
Taka



On 05/19/10 12:44, Takahiro Yasui wrote:
> Hi Petr,
> 
> On 05/19/10 08:06, Petr Rockai wrote:
>> Takahiro Yasui <tyasui@redhat.com> writes:
>>> On 05/14/10 18:52, Takahiro Yasui wrote:
>>>> I also tested this patch for a lvm mirror with core/disk log. When
>>>> a mirror log failed, the mirror log was removed from a mirror volume,
>>>> but a log voluem is not removed from its volume group. This always
>>>> happens both on a transient and persistent error.
>>>
>>> This issue seems related to this part of your patch.
>>>
>>> @@ -1139,6 +1163,8 @@ static int _lvconvert_mirrors_repair(str
>>> ...
>>> -	/*
>>> -	 * Remove all failed_pvs
>>> -	 */
>>> -	if (!_lvconvert_mirrors_aux(cmd, lv, lp, failed_pvs,
>>> -				    lp->mirrors, new_log_count))
>>> -		return 0;
>>> +	if (failed_mirrors) {
>>> +		if (!lv_remove_mirrors(cmd, lv, failed_mirrors, new_log_count,
>>> +				       _is_partial_lv, NULL, 0))
>>> +			return 0;
>>> +
>>> +		if (!_reload_lv(cmd, lv))
>>> +			return 0;
>>> +	}
>>>
>>> When I removed this modification, a log volume was removed as expected.
>>> And also other my test cases also passed.
>>
>> The catch is that this won't work correctly in other cases, especially
>> with transient errors. I suspect the real problem is in not calling
>> _lv_update_log_type in the new code path -- but see below: I cannot
>> reliably fix this without having a reproducer. Also, I would very much
>> like to have the tests you had failing on our regression suite, to avoid
>> similar problem in the future.
> 
> I checked this code, but the value of failed_mirrors is '0' when
> no mirror leg has error. So this code path was not executed in
> my test. This is the reason why log was not removed with
> mirror_log_fault_policy = "remove".
> 
> mirror_log_fault_policy = "allocate," on the other hand, the log
> was removed in the following path.
> 
>         while (replace_mirrors || replace_log) {
>                 ...
>                 if (_lvconvert_mirrors_aux(cmd, lv, lp, NULL,
>                                            lp->mirrors, log_count))
>                         break;
> 
> We need to change the condition so that lv_remove_mirrors() is
> executed.
> 
>>> -	 * Remove all failed_pvs
>>> -	 */
>>> -	if (!_lvconvert_mirrors_aux(cmd, lv, lp, failed_pvs,
>>> -				    lp->mirrors, new_log_count))
>>> -		return 0;
>>> +	if (failed_mirrors) {
> 
> Thanks,
> Taka
> 
> --
> lvm-devel mailing list
> lvm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/lvm-devel



  reply	other threads:[~2010-05-19 17:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-27 15:14 [PATCH] handle transient errors in lvconvert --repair Petr Rockai
2010-04-27 18:03 ` Petr Rockai
2010-05-06 17:30   ` Petr Rockai
2010-05-14 22:52     ` Takahiro Yasui
2010-05-17 23:01       ` Takahiro Yasui
2010-05-19 12:06         ` Petr Rockai
2010-05-19 15:06           ` Takahiro Yasui
2010-05-19 18:31             ` Petr Rockai
2010-05-19 19:46               ` Takahiro Yasui
2010-05-19 20:19                 ` Petr Rockai
2010-05-19 20:31                   ` Alasdair G Kergon
2010-05-19 20:35                   ` Takahiro Yasui
2010-05-20  0:49               ` Takahiro Yasui
2010-05-20  7:40                 ` Petr Rockai
2010-05-20 11:54                   ` Takahiro Yasui
2010-05-19 16:44           ` Takahiro Yasui
2010-05-19 17:15             ` Takahiro Yasui [this message]
2010-05-19 20:26               ` Petr Rockai
2010-04-28 19:37 ` Takahiro Yasui
2010-05-05  7:46   ` Petr Rockai
2010-05-05 15:31     ` Takahiro Yasui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BF41C96.4090702@redhat.com \
    --to=tyasui@redhat.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.