* [linux-lvm] lvresize cannot refresh LV size on on other hosts when extending LV with a shared lock
@ 2020-09-29 8:46 Gang He
2020-09-29 10:41 ` Zdenek Kabelac
2020-09-29 14:02 ` David Teigland
0 siblings, 2 replies; 5+ messages in thread
From: Gang He @ 2020-09-29 8:46 UTC (permalink / raw)
To: linux-lvm
Hello List,
I am using lvm2 v2.03.10(or v2.03.05), I setup a lvm2-lockd based (three nodes) cluster.
I created PV, VG and LV, formated LV with a cluster file system (e.g. ocfs2).
So far, all the things work well, I can write the files from each node.
Next, I extended the online LV from node1, e.g.
ghe-tw-nd1# lvresize -L+1024M vg1/lv1
WARNING: extending LV with a shared lock, other hosts may require LV refresh.
Size of logical volume vg1/lv1 changed from 13.00 GiB (3328 extents) to 14.00 GiB (3584 extents).
Logical volume vg1/lv1 successfully resized.
Refreshing LV /dev//vg1/lv1 on other hosts...
But, the other nodes cannot aware this LV size was changed, e.g.
2020-09-29 16:01:48 ssh ghe-tw-nd3 lsblk
load pubkey "/root/.ssh/id_rsa": invalid format
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 40G 0 disk
��vda1 253:1 0 8M 0 part
��vda2 253:2 0 38G 0 part /
��vda3 253:3 0 2G 0 part [SWAP]
vdb 253:16 0 80G 0 disk
��vdb1 253:17 0 10G 0 part
��vdb2 253:18 0 20G 0 part
� ��vg1-lv1 254:0 0 13G 0 lvm /mnt/shared <<== here
��vdb3 253:19 0 50G 0 part
2020-09-29 16:01:49 ssh ghe-tw-nd2 lsblk
load pubkey "/root/.ssh/id_rsa": invalid format
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 40G 0 disk
��vda1 253:1 0 8M 0 part
��vda2 253:2 0 38G 0 part /
��vda3 253:3 0 2G 0 part [SWAP]
vdb 253:16 0 80G 0 disk
��vdb1 253:17 0 10G 0 part
��vdb2 253:18 0 20G 0 part
� ��vg1-lv1 254:0 0 13G 0 lvm /mnt/shared <<== here
��vdb3 253:19 0 50G 0 part
2020-09-29 16:01:49 ssh ghe-tw-nd1 lsblk
load pubkey "/root/.ssh/id_rsa": invalid format
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 40G 0 disk
��vda1 253:1 0 8M 0 part
��vda2 253:2 0 38G 0 part /
��vda3 253:3 0 2G 0 part [SWAP]
vdb 253:16 0 80G 0 disk
��vdb1 253:17 0 10G 0 part
��vdb2 253:18 0 20G 0 part
� ��vg1-lv1 254:0 0 14G 0 lvm /mnt/shared <<== LV size was changed on node1
��vdb3 253:19 0 50G 0 part
This behavior breaks our cluster high availability, we have to de-activate/activate LV to get LV size refresh.
Is this behavior by-design?
Could we extend the online LV automatically on each node (when any node triggers a LV resize command)?
Thanks
Gang
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-lvm] lvresize cannot refresh LV size on on other hosts when extending LV with a shared lock
2020-09-29 8:46 [linux-lvm] lvresize cannot refresh LV size on on other hosts when extending LV with a shared lock Gang He
@ 2020-09-29 10:41 ` Zdenek Kabelac
2020-09-29 14:02 ` David Teigland
1 sibling, 0 replies; 5+ messages in thread
From: Zdenek Kabelac @ 2020-09-29 10:41 UTC (permalink / raw)
To: LVM general discussion and development, Gang He
Dne 29. 09. 20 v 10:46 Gang He napsal(a):
> Hello List,
>
> I am using lvm2 v2.03.10(or v2.03.05), I setup a lvm2-lockd based (three nodes) cluster.
> I created PV, VG and LV, formated LV with a cluster file system (e.g. ocfs2).
> So far, all the things work well, I can write the files from each node.
> Next, I extended the online LV from node1, e.g.
> ghe-tw-nd1# lvresize -L+1024M vg1/lv1
> WARNING: extending LV with a shared lock, other hosts may require LV refresh.
> Size of logical volume vg1/lv1 changed from 13.00 GiB (3328 extents) to 14.00 GiB (3584 extents).
> Logical volume vg1/lv1 successfully resized.
> Refreshing LV /dev//vg1/lv1 on other hosts...
>
> But, the other nodes cannot aware this LV size was changed, e.g.
lvmlockd does not care about state of LV.
This used to be achieved through clvmd code - but such code is no longer
available with 2.03 branch.
The assumed solution is - the user is supposed to write an engine on top of
lvm2 using some 'clustering' solution and and orchestrate this work himself
(i.e. in this case run 'lvchange --refresh' on other hosts himself
somehow in-sync)
Zdenek
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-lvm] lvresize cannot refresh LV size on on other hosts when extending LV with a shared lock
2020-09-29 8:46 [linux-lvm] lvresize cannot refresh LV size on on other hosts when extending LV with a shared lock Gang He
2020-09-29 10:41 ` Zdenek Kabelac
@ 2020-09-29 14:02 ` David Teigland
2020-09-30 10:08 ` Gang He
1 sibling, 1 reply; 5+ messages in thread
From: David Teigland @ 2020-09-29 14:02 UTC (permalink / raw)
To: Gang He; +Cc: linux-lvm
On Tue, Sep 29, 2020 at 08:46:25AM +0000, Gang He wrote:
> ghe-tw-nd1# lvresize -L+1024M vg1/lv1
> WARNING: extending LV with a shared lock, other hosts may require LV refresh.
> Size of logical volume vg1/lv1 changed from 13.00 GiB (3328 extents) to 14.00 GiB (3584 extents).
> Logical volume vg1/lv1 successfully resized.
> Refreshing LV /dev//vg1/lv1 on other hosts...
Triggering remote lvchange refresh for lvresize has been implemented using
dlm_controld. See configure --enable-lvmlockd-dlmcontrol which enables
lvmlockd to use the libdlmcontrol api dlmc_run_start/dlm_run_check.
Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-lvm] lvresize cannot refresh LV size on on other hosts when extending LV with a shared lock
2020-09-29 14:02 ` David Teigland
@ 2020-09-30 10:08 ` Gang He
2020-09-30 14:15 ` David Teigland
0 siblings, 1 reply; 5+ messages in thread
From: Gang He @ 2020-09-30 10:08 UTC (permalink / raw)
To: David Teigland; +Cc: linux-lvm
Hi David,
Thank for your helps.
On 9/29/2020 10:02 PM, David Teigland wrote:
> On Tue, Sep 29, 2020 at 08:46:25AM +0000, Gang He wrote:
>> ghe-tw-nd1# lvresize -L+1024M vg1/lv1
>> WARNING: extending LV with a shared lock, other hosts may require LV refresh.
>> Size of logical volume vg1/lv1 changed from 13.00 GiB (3328 extents) to 14.00 GiB (3584 extents).
>> Logical volume vg1/lv1 successfully resized.
>> Refreshing LV /dev//vg1/lv1 on other hosts...
>
> Triggering remote lvchange refresh for lvresize has been implemented using
> dlm_controld. See configure --enable-lvmlockd-dlmcontrol which enables
> lvmlockd to use the libdlmcontrol api dlmc_run_start/dlm_run_check.
> Dave
That means LV size will be refreshed automatically if this configure
option is enabled, right?
If we do not enable this configure option, we can use "lvchange
--refresh vg/lv" on the other nodes to synchronize LV size, right?
This command will affect the upper cluster file system if it is running?
Thanks
Gang
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-lvm] lvresize cannot refresh LV size on on other hosts when extending LV with a shared lock
2020-09-30 10:08 ` Gang He
@ 2020-09-30 14:15 ` David Teigland
0 siblings, 0 replies; 5+ messages in thread
From: David Teigland @ 2020-09-30 14:15 UTC (permalink / raw)
To: Gang He; +Cc: linux-lvm
On Wed, Sep 30, 2020 at 06:08:53PM +0800, Gang He wrote:
> Hi David,
>
> Thank for your helps.
>
> On 9/29/2020 10:02 PM, David Teigland wrote:
> > On Tue, Sep 29, 2020 at 08:46:25AM +0000, Gang He wrote:
> > > ghe-tw-nd1# lvresize -L+1024M vg1/lv1
> > > WARNING: extending LV with a shared lock, other hosts may require LV refresh.
> > > Size of logical volume vg1/lv1 changed from 13.00 GiB (3328 extents) to 14.00 GiB (3584 extents).
> > > Logical volume vg1/lv1 successfully resized.
> > > Refreshing LV /dev//vg1/lv1 on other hosts...
> >
> > Triggering remote lvchange refresh for lvresize has been implemented using
> > dlm_controld. See configure --enable-lvmlockd-dlmcontrol which enables
> > lvmlockd to use the libdlmcontrol api dlmc_run_start/dlm_run_check.
> > Dave
> That means LV size will be refreshed automatically if this configure option
> is enabled, right?
right
> If we do not enable this configure option, we can use "lvchange --refresh
> vg/lv" on the other nodes to synchronize LV size, right?
right
> This command will affect the upper cluster file system if it is running?
I'm not sure I underststand, but extending the lv shouldn't effect the fs.
Extending the fs (e.g. gfs2_grow) will make the fs use the new space.
Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-09-30 14:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 8:46 [linux-lvm] lvresize cannot refresh LV size on on other hosts when extending LV with a shared lock Gang He
2020-09-29 10:41 ` Zdenek Kabelac
2020-09-29 14:02 ` David Teigland
2020-09-30 10:08 ` Gang He
2020-09-30 14:15 ` David Teigland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).