Re: understanding the tree-log

2011-11-04 Thread Phillip Susi

On 11/4/2011 1:09 AM, Liu Bo wrote:

Btrfs has an expensive "commit transaction", if we commit a transaction every 
time we fsync,
the performance is not that good.  Instead of this, we introduce a write-ahead 
log to make
our fsync faster.

So if you do fsync for your data, it means your data is safely in the log tree,
then if a crash takes place, the data can be recovered from log.


How can you write to the log tree without a full commit?  The tree of 
tree roots has to point to the root node of the log tree, so when you 
write out the log tree, that needs updated too, which requires a full 
commit doesn't it?


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


Re: understanding the tree-log

2011-11-03 Thread Liu Bo
On 11/04/2011 11:21 AM, Phillip Susi wrote:
> Given how a transaction is committed, why is there a tree-log?  When
> modifying the tree, either the super block is still pointing to the
> old tree root, or the new generation has been fully committed, so how
> can there ever be an intermediate state that needs a log to recover?

tree-log is for improving the preformance  of fsync and and O_SYNCs.

Btrfs has an expensive "commit transaction", if we commit a transaction every 
time we fsync,
the performance is not that good.  Instead of this, we introduce a write-ahead 
log to make
our fsync faster.

So if you do fsync for your data, it means your data is safely in the log tree,
then if a crash takes place, the data can be recovered from log.

More details are in tree-log.c.

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


understanding the tree-log

2011-11-03 Thread Phillip Susi
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Given how a transaction is committed, why is there a tree-log?  When
modifying the tree, either the super block is still pointing to the
old tree root, or the new generation has been fully committed, so how
can there ever be an intermediate state that needs a log to recover?
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6zWiwACgkQJ4UciIs+XuK+FQCfTnTIu8iYgW38Qk3YoZ4KjA/9
uhwAnjOH36EkQ1EhoUdWg7OJr+0L0lbA
=7DUz
-END PGP SIGNATURE-
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html