From: Kai Krakow <hurikhan77+btrfs@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Possible to wait for snapshot deletion?
Date: Thu, 13 Feb 2014 20:02:43 +0100 [thread overview]
Message-ID: <jfhvsa-unf.ln1@hurikhan77.spdns.de> (raw)
Hi!
Is it technically possible to wait for a snapshot completely purged from
disk? I imagine an option like "--wait" for btrfs delete subvolume.
This would fit some purposes I'm planning to implement:
* In a backup scenario have a subprocess which deletes snapshots one by one,
starting with the oldest. If free space raises above a certain threshold,
pause the subprocess. If number of kept snapshots falls below a certain
threshold, exit the subprocess. When the backup job finished, it joins the
subprocess to wait for a pending subvolume deletion if any, then syncs the
filesystem and waits some grace time for uncommitted writes, then shuts
the system down or hibernates it.
* Wait for pending background subvolume deletion before putting the system
to sleep.
* Get better control of cron jobs working with subvolumes so jobs either do
not overlap or do not put too much parallel work on the file system.
Scrubbing does allow that. Why don't snapshots do? At least I found no
options for it.
Background information: If btrfs is shut down improperly, already deleted
subvolume entries may reappear in their directories. The deletion is not
gracefully resumed. Since deletion of subvolumes/snapshots can take hours,
this is a problem for systems that are not guaranteed to be up all the time
or suffer from disconnected power, especially if multiple snapshots are
being deleted at once. With an option to wait, a script managing snapshot
deletion could more gracefully resume its job.
--
Replies to list only preferred.
next reply other threads:[~2014-02-13 19:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 19:02 Kai Krakow [this message]
2014-02-13 19:29 ` Possible to wait for snapshot deletion? Brendan Hide
2014-02-14 0:25 ` Kai Krakow
2014-02-13 19:57 ` Hugo Mills
2014-02-13 20:45 ` Garry T. Williams
2014-02-14 0:12 ` Kai Krakow
2014-02-14 16:05 ` David Sterba
2014-02-13 21:42 ` Holger Hoffstätte
2014-02-14 0:15 ` Kai Krakow
2014-02-14 16:15 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jfhvsa-unf.ln1@hurikhan77.spdns.de \
--to=hurikhan77+btrfs@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).