openebs / lvm-localpv

Dynamically provision Stateful Persistent Node-Local Volumes & Filesystems for Kubernetes that is integrated with a backend LVM2 data storage stack.
Apache License 2.0
263 stars 99 forks source link

[PVC Expand]A special case will case pvc updated, but not expand lv by lvm-node #220

Open esimest opened 1 year ago

esimest commented 1 year ago

Description

As https://github.com/openebs/lvm-localpv/blob/v0.8.x/design/lvm/images/resize_sequence_diagram.jpg show If happen:

  1. step "Mark PVC As Filesystem resize required" Failed.
  2. Skip NodeExpandVolume
  3. run whole steps again

But when executing this process for the second time, it will happen:

  1. ControllerExpandVolume return fsResizeRequired=nil because of https://github.com/openebs/lvm-localpv/blob/develop/pkg/driver/controller.go#L544
  2. step "Mark PVC As Filesystem resize required" skipped, and run markPVCResizeFinished.(mark pvc update finished)
  3. skip NodeExpandVolume

Conclusion

So In above case, it will happen pvc updated finsihed but lv didn't resize

Describe

lv can resize normally even if above case happen.

dung-tien-nguyen commented 1 year ago

Make sure that when you run the command lvs, lvm corresponds to the PV which is doing the resize error, has the status "-wi-ao----"

If the status is: "-wi-a-----" means that the pv is generated but not used by any container at all. This also results in resize failure (since kubelet doesn't trigger NodeExpandVolume event to lvm node )

image

abhilashshetty04 commented 1 year ago

@esimest Thanks for reporting the issue. Can you please let us know how did you reproduce this?

dsharma-dc commented 5 months ago

Would be helpful to get some more clear details about the reproducing the problem so that we can look into it. Please share the user action details to help better. Also, as mentioned by @dung-tien-nguyen , the filesystem will not expand until the volume is published i.e. used by an application.

avishnu commented 2 months ago

Further investigation needed. Investigation scoped for v4.2.