linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Questions regarding COW-related behaviors
@ 2010-11-08 14:23 João Eduardo Luís
  2010-11-08 17:31 ` Goffredo Baroncelli
  2010-11-08 22:45 ` Sean Bartell
  0 siblings, 2 replies; 6+ messages in thread
From: João Eduardo Luís @ 2010-11-08 14:23 UTC (permalink / raw)
  To: linux-btrfs

Hello list.


I've been working on my MSc thesis and I believe such a time came when =
it will cross paths with BTRFS.

However, I have a couple of standing questions I haven't been able do a=
nswer, even though having read Ohad Rodeh's paper, most of the wiki's d=
ocumentation, after looking to BTRFS' code and after testing it myself =
--- I'm not putting aside missing some information, somewhere, though.

Basically, I need to be aware how the COW works in BTRFS, and what it m=
ay allow one to achieve. Questions follow.

1) Is COW only used when creating or updating a file? While testing BTR=
=46S, using 'btrfs subvolume find-new', I got the idea that neither cre=
ation of directories, nor any kind of deletion are covered by COW. Is t=
his right?

2) Each time a COW happens, is there any kind implicit 'snapshotting' t=
hat may keep track of changes around the filesystem for each COW?=20
By Rodeh's paper and some info on the wiki, I gather that a new root is=
 created for each COW, due to shadowing, but will the previous tree be =
kept? The wiki, at "BTRFS Design", states that "after the commit finish=
es, the older subvolume root items may be removed". This would make imp=
ossible to track changes to files, but 'btrfs subvolume find-new' still=
 manages to output file generations, so there must be some info left be=
hind.=20

3) Following (2), is there any way to access this informations and, let=
's say, recover an older version of a given file? Or an entire previous=
 tree?

4) From Rodeh's paper I got the idea that BTRFS uses periodic checkpoin=
ting, in order to assign generations to operations. Using 'btrfs subvol=
ume find-new' I confirmed my suspicions. After copying two different di=
rectories into the same subvolume at the same time, all files got assig=
ned the same generation and it took a while until they all showed up. T=
his raises the question: what triggers a new checkpoint? Is it based on=
 elapsed time since last checkpoint? Is it triggered by a COW and then,=
 all COWs happening at the same time will be put together and create a =
big new generation?

5) If we have multiple jobs updating the same file at the same time, I =
assume the system will shadow their updates; when the time for committi=
ng comes, will there be any kind of 'conflict' between concurrent updat=
es, or will they be applied by order of commit, ignoring whether there =
were previous commits or not? Regarding checkpointing, will all the cha=
nges be shown as part of the generation, or will they be considered as =
only one?


I would greatly appreciate any answer regarding any of this topics, inc=
luding any pointers to additional documentation that I may have missed.


Regards.


---
Jo=E3o Eduardo Lu=EDs




--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-11-09 19:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-08 14:23 Questions regarding COW-related behaviors João Eduardo Luís
2010-11-08 17:31 ` Goffredo Baroncelli
2010-11-08 22:45 ` Sean Bartell
2010-11-08 23:05   ` Chris Samuel
2010-11-09 14:18   ` João Eduardo Luís
2010-11-09 19:37     ` Goffredo Baroncelli

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).