-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Detect dirty regions containing only zeroes during incremental backup (fstrim) #250
Comments
Good day! Here https://github.com/oVirt/ovirt-imageio/tree/master they use qemu:allocation-depth with base:allocation context to detect holes. Maybe we should use it?
|
the ovirt-imageio project has a complete nbd client implementation, as in, the plain NBD protocol. This project in https://github.com/abbbi/virtnbdbackup/tree/issue_250 iam attempting a POC for the functionality. Ive already enhanced the extent handler to query both the base:allocation |
Good day! I see your effors in branch issue_250. I have one remark if I rightly understand your code
Maybe we should use |
yes, this is WIP and probably very buggy. Could also be i'm on the wrong track here :-) |
I think best solution will be write zero extents without payload, so we can save space. And if algorithm of virtnbdbackup will include extents with zeros - impact will be minimal, because of zero payload. Is virtnbdbackup backend ready for zero extens with no payload? |
zero extents are already stored in this way. Its just that during incremental backup fstrim situations are not handled. |
Good day! As far as I understand you use this apporoach: Take dirtybitmaps and base allocation extents and use base-allocation extents to filter extents, that do not have valid data, and write data in range of dirtybitmaps to backup file. I think we can make this task in another way: On incremental backup phase we have to collect base-allocation extents and use dirtybitmaps with 1 to include base-allocation extents into backup if they are in ranges dirty-bitmap, and after that we can unify extents to write data. In this approach we include data extents and zero extents to reflect changes to backup. |
Good day! Could you please review my patch for fixing extents calculation?
|
hi Roman, thanks for digging into this! This looks quite good, first tests show that behavior on fstrim has improved alot. Im going to tidy up things a bit in the next weeks (--qemu option needs to be fixed, to pass the bitmap too, amongst |
As discussed in:
#139 (comment)
#139 (reply in thread)
The current situation is:
The proposed solution could be that during incremental/differential backup, the nbd client requests both the actual bitmap and the base allocation bitmap from the nbd service.
The extend handler could then check if the block that is marked as changed within the bitmap is actually a zero block in the BASE_ALLOCATION bitmap and skip those.
Current workarounds for users:
To reproduce:
<driver name='qemu' type='qcow2' discard='unmap'/>
Incremental backup will backup:
Total saved disk data: [15.9MB]
Now delete the data file and run fstrim:
Next incremental backup will be as big:
Total saved disk data: [18.6MB]
The text was updated successfully, but these errors were encountered: