Yoshiki Hayashi <yoshiki@xemacs.org> writes:
> If I understand it correctly, svn_fs_abort_txn needs
> svn_error_t *svn_fs__dag_destroy_tree (dag_node_t *root),
> which walk thorough a tree and removes all mutable nodes
> from nodes table by calling db->del(). In STACK,
> svn_fs__dag_delete is mentioned. But it's for svn rm (or
> whatever it's called) operation and it doesn't remove node
> from nodes table, right?
If the node being deleted is mutable, svn_fs__dag_delete must remove
it from the nodes table. We're currently missing functions in
node-rev.c and nodes-table.h to support this; they'll need to be
added.
Since the documentation for svn_fs__dag_delete says that "if the node
being deleted is a mutable directory, it must be empty," we don't need
to do any recursive tree walking here.
If we do need a recursive deletion function, it must *not* be in
dag.c. The whole point of dag.c is to be as simple as possible while
still having enough information to guarantee the consistency of the
filesystem. So anything which can be written as a client of dag.c's
interface should be. If this causes major performance losses, then we
need to think things over.
> There's an argument for making the nodes immutable when
> close_file is called. You can't do it or you won't be able
> to distinguish which nodes were created in that transaction.
Yes, you can. Any mutable node reachable from a transaction root
belongs to that transaction only. Mutable nodes are always private to
the transaction they were created in; they never appear in more than
one transaction's tree. So you just start from the transaction's
root, and delete nodes until you hit mutable nodes.
> svn_fs_abort_txn will also need svn_fs__destroy_txn, which
> will remove transaction entry from transactions table.
That's right. We'll need to add a function to txn-table.[ch].
Received on Sat Oct 21 14:36:23 2006