Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(backup): skip loading the backingFile when doing backup or when user requests exporting the volume without backingFile #1187

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

PhanLe1010
Copy link
Contributor

@PhanLe1010 PhanLe1010 commented Aug 13, 2024

@ChanYiLin has awesome analysis that sometime we are still loading backing file layer on sle-micro ARM64 when doing backup link. This is not correct because we should skip loading backing file when doing backup

The current implementation relies on the assumption that file descriptor of backingFile is always 0 and uses it to skip loading the backingFile layer: link . However, this assumption is not always correct. For example, with RAW backing image, fd is not 0. See more details at link . For qcow backing image, that assumption is correct because qcow image has hard coded to have FD 0 here https://github.com/longhorn/longhorn-engine/blob/04c645097a4a93e46f0f0391222895ea06b25456/pkg/qcow/libqcow.go#L84-L87

This PR propose a this fix which always skip loading backingFile and doesn't rely on the assumption that backing file has fd as 0

longhorn/longhorn#9209

@PhanLe1010
Copy link
Contributor Author

Doing more testing

@ChanYiLin
Copy link
Contributor

Hi @PhanLe1010
Thanks for your quick fix!

Can we then remove the fd=0 check in the LoadDiffDiskLocationList() since now we use a parameters isThereBackingFile to skip the BackingImage. Thanks

pkg/replica/diff_disk.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ChanYiLin ChanYiLin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also fix the incorrect comments that mention index0 could be BackingImage.

app/cmd/replica.go Outdated Show resolved Hide resolved
@PhanLe1010 PhanLe1010 force-pushed the 9209 branch 2 times, most recently from 13ff938 to bc499c8 Compare August 13, 2024 03:31
…ser request

exporting the volume without backingFile

longhorn-9209

Signed-off-by: Phan Le <phan.le@suse.com>
@PhanLe1010
Copy link
Contributor Author

Can you help with the testing @ChanYiLin ?

@PhanLe1010 PhanLe1010 changed the title Skip loading the backingFile when doing backup or when user requests exporting the volume without backingFile fix(backup): skip loading the backingFile when doing backup or when user requests exporting the volume without backingFile Aug 13, 2024
@ChanYiLin
Copy link
Contributor

@PhanLe1010 sure no problem!

@PhanLe1010
Copy link
Contributor Author

Thanks @ChanYiLin for building the image jackfantasy/longhorn-engine:9209

I did some manual test and it passed on sle-micro ARM64

I will rely on you for the rest of the work. Thank you

@ChanYiLin
Copy link
Contributor

ChanYiLin commented Aug 13, 2024

Test test_system_backup_and_restore_volume_with_backingimage 20 times PASSED

  • sle-micro arm64

https://ci.longhorn.io/job/private/job/longhorn-tests-regression/7451/

@ChanYiLin
Copy link
Contributor

Test test_basic.py RUNNING

  • sle-micro arm64

https://ci.longhorn.io/job/private/job/longhorn-tests-regression/7453/console

@derekbit derekbit merged commit 449c3bd into longhorn:master Aug 13, 2024
13 checks passed
@derekbit
Copy link
Member

@mergify backport v1.7.x

Copy link

mergify bot commented Aug 13, 2024

backport v1.7.x

✅ Backports have been created

@derekbit
Copy link
Member

@mergify backport v1.6.x v1.5.x

Copy link

mergify bot commented Aug 13, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants