Skip to contentSkip to conversation

Handle transient errors for mirrored log in lvconvert --repair

PATCH New Takahiro Yasui 2 participants 5 messages Jul 29, 2010 – Aug 4, 2010

lore
Share & tools
lore
#0 lore raw

Hi Petr,

I would like to continue a discussion about how to handle transient error for mirrored log.

[lvm-devel] [PATCH] handle transient errors in lvconvert --repair
https://www.redhat.com/archives/lvm-devel/2010-May/msg00173.html

Quoted 5 lines

_lvconvert_mirrors_repair()
...
lv_check_transient(lv); /* TODO check this in lib for all commands? */

(quoted diff) +0 -1
-       if (!(lv->status & PARTIAL_LV)) {

Review

Quoted 10 lines
(quoted diff) +6 -1
+       log_lv = first_seg(lv)->log_lv;
+       if (log_lv && log_lv->status & MIRRORED)
+               lv_check_transient(log_lv);
+
+       if (!(lv->status & PARTIAL_LV) && !log_lv &&
+           !(log_lv->status & PARTIAL_LV)) {
...
        new_log_count = old_log_count;
-       log_lv = first_seg(lv)->log_lv;
        if (log_lv) {

As shown above, I hope this kind of code to be added to check the status of a log volume.

I understand your concern that this doesn't cover all cases. For example, there might be a problem when mirror_{log|mirror}_fault_policy is set to 'allocate' instead of 'removed.'

lv_check_transient() marks logical volumes as PARTIAL_LV based on the status reported by kernel, but it doesn't mark physical volumes which are a part of partial logical volumes. This means that a mirror volume is repaired by removing partial volumes, but physical devices, which were a part of the partial volumes, could be re-allocated for a mirror leg or a mirror log later. The re-allocation may be a problem if the repair was triggered by medium errors.

Here is a discussion. We can rescue a case that 'removed' policy is set to mirror_{log|mirror}_fault_policy by adding lv_check_transient() for a mirrored log volume, while application will hang up when a transient error or medium error occurred on mirrored log without this patch.

How about adding the patch for a short term solution to save in the case of 'removed' policy? We have already made a decision when the first patch is committed.

https://www.redhat.com/archives/lvm-devel/2010-May/msg00217.html

If the patch makes something worse, I agree that we need to fix it or find a better solution, but one of the most important functions of mirroring is to let system running even though one of mirror legs or log broke. I believe that the patch helps to achieve it. I agree that 'allocate' is an important policy, but I would be grad if 'remove' policy works well at first.

I appreciate your comments.

Thanks,
Taka

#1 lore raw

Hi Taka,

Quoted 2 lines · Takahiro Yasui

As shown above, I hope this kind of code to be added to check the status of a log volume.

[snip]

Quoted 4 lines

I understand your concern that this doesn't cover all cases. For example, there might be a problem when mirror_{log|mirror}_fault_policy is set to 'allocate' instead of 'removed.'

Quoted 8 lines

Here is a discussion. We can rescue a case that 'removed' policy is set to mirror_{log|mirror}_fault_policy by adding lv_check_transient() for a mirrored log volume, while application will hang up when a transient error or medium error occurred on mirrored log without this patch.

How about adding the patch for a short term solution to save in the case of 'removed' policy? We have already made a decision when the first patch is committed.

I think the main concern is that a sync over a partially failing PV will make things a lot worse. On the other hand, I agree that having multiple failing devices is a rare situation. I would concede to the following:

If a transient error is detected, repair the mirror as usual through down-conversion, but refuse to do any allocation. This is the same situation as when there are no spare PVs available. This is a conservative over-approximation that is always correct. We are issuing a log_warn that the mirror could not be restored to its previous state, which should end up in syslog. From there, this is a matter of the sysadmin to take action. The mirror should keep operating in a reduced mode in the meantime.

If this was noted in documentation, I think this would be appropriate for RHEL6. The check wouldn't be very hard to do, I believe: Count the number of partial LVs in the VG before the transient check and count again after, if the numbers differ, forbid any new allocations.

Would you find such a solution acceptable? Overall, it in the case of a transient failure, it will work as if "remove" was specified regardless of actual lvm.conf setting. For permanent failures, the policy is respected as previously.

Yours,
Petr.

#2 lore raw

Hi Petr,

Quoted 32 lines · Petr Rockai
Quoted 2 lines · Takahiro Yasui

As shown above, I hope this kind of code to be added to check the status of a log volume.

[snip]

Quoted 4 lines

I understand your concern that this doesn't cover all cases. For example, there might be a problem when mirror_{log|mirror}_fault_policy is set to 'allocate' instead of 'removed.'

Quoted 8 lines

Here is a discussion. We can rescue a case that 'removed' policy is set to mirror_{log|mirror}_fault_policy by adding lv_check_transient() for a mirrored log volume, while application will hang up when a transient error or medium error occurred on mirrored log without this patch.

How about adding the patch for a short term solution to save in the case of 'removed' policy? We have already made a decision when the first patch is committed.

I think the main concern is that a sync over a partially failing PV will make things a lot worse. On the other hand, I agree that having multiple failing devices is a rare situation. I would concede to the following:

If a transient error is detected, repair the mirror as usual through down-conversion, but refuse to do any allocation. This is the same situation as when there are no spare PVs available. This is a conservative over-approximation that is always correct. We are issuing a log_warn that the mirror could not be restored to its previous state, which should end up in syslog. From there, this is a matter of the sysadmin to take action. The mirror should keep operating in a reduced mode in the meantime.

Quoted 4 lines

If this was noted in documentation, I think this would be appropriate for RHEL6. The check wouldn't be very hard to do, I believe: Count the number of partial LVs in the VG before the transient check and count again after, if the numbers differ, forbid any new allocations.

Your idea sounds good to me. The 'remove' policy should always work, but the 'allocate' policy can be optional. It means that it should work only when it satisfies requirements. (e.g. there are enough spare disks, the number of non-partial volumes which is counted before the transient check is the same as the count after the transient check, etc)

Quoted 4 lines

Would you find such a solution acceptable? Overall, it in the case of a transient failure, it will work as if "remove" was specified regardless of actual lvm.conf setting. For permanent failures, the policy is respected as previously.

Yes, this solution is acceptable to me. As a long term, we can introduce a kind of logic to keep the information of a bad segment or device and extend cases for 'allocate' policy.

Thanks,
Taka

#3 lore raw

PATCH 1/1 Handle transient errors for mirrored log in lvconvert --repair

Hi again,

Quoted 3 lines · Takahiro Yasui

Yes, this solution is acceptable to me. As a long term, we can introduce a kind of logic to keep the information of a bad segment or device and extend cases for 'allocate' policy.

great. I am attaching a patch proposal that would implement the outlined policy. I have tucked in a warning for a good measure.

The patch still needs some testing, which I'd appreciate if you could carry out. I will be away from internet starting tomorrow noon CEST and should be back approximately Tuesday evening next week (still CEST). I am afraid I won't have more time for this until after I return.

Yours,
Petr.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvconvert-transient-mirroredlog.diff
Type: text/x-diff
Size: 3862 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20100729/f4687d7b/attachment.bin>

#4 lore raw

PATCH 1/1 Handle transient errors for mirrored log in lvconvert --repair

Review static int _lv_update_mirrored_log(struc

Quoted 9 lines · Petr Rockai
Quoted 3 lines · Takahiro Yasui

Yes, this solution is acceptable to me. As a long term, we can introduce a kind of logic to keep the information of a bad segment or device and extend cases for 'allocate' policy.

great. I am attaching a patch proposal that would implement the outlined policy. I have tucked in a warning for a good measure.

(quoted diff) +0 -0
@@ -696,6 +703,13 @@ static int _lv_update_mirrored_log(struc
@@ -705,12 +719,9 @@ static int _lv_update_mirrored_log(struc

I believe that two changes in _lv_update_mirror_log() are not for solving this issue, and they are already checked in. :)

Review static int _lvconvert_mirrors_repair(str · line 1204

Quoted 5 lines
(quoted diff) +4 -0
@@ -1179,14 +1201,22 @@ static int _lvconvert_mirrors_repair(str
+	if (log_lv)
+		lv_check_transient(log_lv);
+
+	partial_count += _partial_lv_count(lv->vg);

If the log LV is not a mirrored log, we don't need to check the transient status. I see that lv_check_transient() can handle both a disk log and a mirrored log but checking its status as below reduces code steps to be executed.

+ if (log_lv && log_lv->status & MIRRORED)
+ lv_check_transient(log_lv);

Other than that, your patch looks OK to me.

Thanks,
Taka