-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
lvm2 pool: Export immutable snapshot of volume #461
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #461 +/- ##
=======================================
Coverage 65.81% 65.81%
=======================================
Files 53 53
Lines 10007 10019 +12
=======================================
+ Hits 6586 6594 +8
- Misses 3421 3425 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@marmarek how do you want me to deal with cleaning up the exported volumes? |
c19f2d2
to
9f8dbc0
Compare
9f8dbc0
to
e7ca457
Compare
Volumes returned by `export()` must be immutable, since otherwise the backup will be inconsistent. Ensure this by exporting a snapshot of the volume, no the volume itself. Fixes QubesOS/qubes-issues#7198.
There is no need to invalidate a cache if nothing will access it before it is invalidated again.
It isn't used anymore.
e7ca457
to
5eb6240
Compare
The volume currently used for backup is immutable (in a sense that its content is not modified). VMs are writing to While your change will make it more likely that VM size and data are taken from similar time, the behavior change here is actually harmful: it will backup older data than it could. In fact, I consider changing the backup export to take a snapshot of a "dirty" volume to backup newer version, not older. Theoretically, it should be sufficiently safe with journaled filesystem (as long as the snapshot operation itself is atomic). Please note QubesOS/qubes-issues#7198 in practice not about the time disk usage is recorder, but about recording size of a different thing. And also, the consensus there is to fix it differently - changing how limit is enforced. |
That is true, and even for non-journaled filesystems it should at most require a call to fsck.
Does this mean that I should close this PR as “won’t do”? |
It may be a good base for the change I proposed above (which version to backup). But that needs a proper task description (extend QubesOS/qubes-issues#1239?), and also consider other storage drivers. |
Marking as draft for now. It is worth noting that snapshotting in-use volumes breaks an invariant that currently holds, and which a direct dm-thin driver would need to consider. But that is doable. |
Volumes returned by
export()
must be immutable, since otherwise thebackup will be inconsistent. Ensure this by exporting a snapshot of the
volume, no the volume itself.
Fixes QubesOS/qubes-issues#7198.
FIXME: tests