[lvm-devel] [PATCH] clvmd: try to refresh device cache on the first failure
Eric Ren
zren at suse.com
Thu Jun 1 01:54:16 UTC 2017
Hi!
On 05/31/2017 08:15 PM, Zdenek Kabelac wrote:
> [...snip...]
>> Thanks for your information:-P
>>
>> Unfortunately, I still failed to tell the problem clearly. Since this problem can be
>> reproduced easily, I debugged it step by step using
>> gdb, and read most of code paths relative to this problem. It's indeed a problem that
>> "device cache" in clvmd is not updated as needed.
>
> And as was already mentioned - this is a documented and the only supported logic in clvmd.
>
> If user runs WITHOUT obtain_device_list_from_udev == 1 (i.e. command does scan and
> manually discover device and maintains .cache file) it's admin responsibility to refresh
> device cache when ANY new device appears.
>
> It's seen counterproductive to NOT use udev and yet want udev to update .cache.
>
> So the only issue we care here is - user has obtain == 1 and yet clvmd does NOT work
> correctly - doing any code analysis is premature here...
This problem can be reproduced no matter 'obtain_device_list_from_udev == 1' or 'obtain_xx
== 0'.
The reason why I mention 'obtain...' here is, several days ago on IRC, when I tried
'obtain... == 0' following your
instructions, the problem *disappeared*, so I thought, yes, udev has something wrong! But,
as mentioned previously,
I was cheated because do_refresh_cache() will be called if lvm.conf is *changed*.
>
>> 4. What is the problem?
>> clvmd missed a chance to update its device cache when a MD device is assembled, because
>> 'pvscan' triggered by udev rules exits
>> too early to call lock_vol(..., VG_GLOBAL, ...).
>
> pvscan in UDEV rules is ONLY for 'lvmetad' nothing else and certainly not for clvmd.
Yeah, this is the problem. So, do_refresh_cache() won't be called when underlying device
changes.
>
>> Hope I make this issue understood this time. But, I have to admit that this fix in pvscan
>> tool looks nasty:-/
>>
>
>
> So if you still see reproducible problem feel free to regular community bugzilla at:
>
> https://bugzilla.redhat.com/enter_bug.cgi?product=LVM%20and%20device-mapper
Thanks, will do.
Regards,
Eric
>
>
> Regards
>
> Zdenek
>
> --
> lvm-devel mailing list
> lvm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/lvm-devel
>
More information about the lvm-devel
mailing list