Bug 1078336 - snapper: snapshots lost on power loss
snapper: snapshots lost on power loss
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem
Current
Other Other
: P4 - Low : Enhancement (vote)
: ---
Assigned To: Arvin Schnell
E-mail List
https://trello.com/c/T0rphFVp/2053-op...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-30 16:34 UTC by Ignaz Forster
Modified: 2020-08-27 10:49 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---
aschnell: needinfo? (iforster)


Attachments
snapper with fsync calls (254.28 KB, application/x-rpm)
2020-08-24 11:58 UTC, Arvin Schnell
Details
snapper with fsync calls (365.18 KB, application/x-rpm)
2020-08-24 11:58 UTC, Arvin Schnell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ignaz Forster 2018-01-30 16:34:23 UTC
When creating a snapshot, e.g. with 'snapper create', and pulling the power cable immediately or soon after this, the snapshot will not be visible by 'snapper list'. The reason is that the information in /.snapshots/<number>/info.xml hasn't necessarily been synced onto the disk yet.

Steps to reproduce:
* `snapper create`
* `snapper list` (the snapshot is still listed)
* Pull the power cable / force shutdown of the VM
* Restart the machine
* `snapper list` (the snapshot is no longer visible)

This will cause problems in the future, as that snapshot won't be cleaned up automatically and will take more and more space due to Btrfs' CoW.

This could easily be avoided by syncing the metadata files (and - according to the manpage - also the newly created directories) to disk before actually creating the Btrfs snapshot (e.g. by using fsync).
Comment 1 Arvin Schnell 2018-02-01 10:02:55 UTC
I added a card to the YaST trello task board so that the issue is
prioritised with the other tasks.
Comment 2 Arvin Schnell 2020-08-24 11:58:07 UTC
I cannot reproduce the problem even if I shut down the virtual machine
within seconds after creating a snapshot. Real hardware for testing is
currently not available.

Please test the attached RPMs.
Comment 3 Arvin Schnell 2020-08-24 11:58:35 UTC
Created attachment 840981 [details]
snapper with fsync calls
Comment 4 Arvin Schnell 2020-08-24 11:58:57 UTC
Created attachment 840982 [details]
snapper with fsync calls
Comment 5 Arvin Schnell 2020-08-27 10:23:04 UTC
PR: https://github.com/openSUSE/snapper/pull/548
Comment 6 Arvin Schnell 2020-08-27 10:47:29 UTC
SR: https://build.opensuse.org/request/show/829955
Comment 7 Arvin Schnell 2020-08-27 10:49:47 UTC
Assuming that the issue is fixed by PR above.