[Btrfs-devel] Somthing like "userlevel transactions"? [WAS
Booting from snapshot and more...]
chris.mason at oracle.com
Tue Jan 22 06:08:35 PST 2008
On Monday 21 January 2008, sftf wrote:
> Sorry, I was wrong thinking about booting from snapshot...
> So now, will be possible with btrfs scenario like this:
> - make (writable?) snapshots of whole system (all filesystems) before
> dangerous things
> - do what we want (upgrade, install new software...)
> - then "apply" these changes and remove those snapshots or
> "rollback" changes by (re)booting, mounting snapshots and discarding
> changes since these snapshots.
Yes, the above would be possible, as long as rollback was considered a manual
operation. The FS can't know how the files are being used, so it can't just
replace them with older versions.
> Or even:
> - explicitly start transaction(s) on filesystem(s) with userspace tool
> (btrfsctl) - do what we want
> - commit or rollback transaction (like in RDBMS)
Unfortunately, the kinds of transactions that userland wants don't mix well
with the kernel. Basically the kernel needs to be able to close transactions
sometimes in order to reclaim memory and disk space. It might also need to
do it for events like sync or snapshot creation.
A userland transaction can run forever, and it implies a transaction abort if
the process dies before it commits. This is very different from the
transactions done in the kernel now.
It is definitely an interesting problem, but well outside the scope of Btrfs'
current feature list.
More information about the Btrfs-devel