[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

svn_fs_node_created_rev applied to transaction root differs between FSFS and BDB

From: David Glasser <glasser_at_mit.edu>
Date: 2006-09-11 08:13:49 CEST

I found a bug (#2608) where you could commit directory property
changes against a directory that was not up to date.

Further research revealed that this occured only on the root directory
and only under FSFS. I added a python test in prop_tests.py
(commit_conflict_dirprops) and a C test in repos-test.c
(created_rev_root) to detect this issue. (It's possible this should
have gone in fs-test.c, since the only repos API I used was the
trivially rewritable svn_repos_fs_begin_txn_for_commit.)

At the low level, it comes down to creating a new repo and running:

  SVN_ERR(svn_repos_fs_begin_txn_for_commit(&txn,
                                            repos,
                                            0,
                                            "someuser", "log",
                                            spool));
  SVN_ERR(svn_fs_txn_root(&txn_root, txn, spool));
  SVN_ERR(svn_fs_node_created_rev(&rev, txn_root, "", spool));

"rev" is 0 on BDB and SVN_INVALID_REVNUM on FSFS.

I've done a whole lot of digging through the FS code, and the
difference between BDB and FSFS seems to be roughly as follows. Both
FSFS and BDB implement node_created_rev by calling a "get_dag"
function and then calling "svn_fs_FOO__dag_get_revision" on it.

FSFS and BDB seem to have different schemas for their node IDs: BDB
uses one "transaction ID" for either revision nodes or transaction
nodes, whereas FSFS differentiates. The DAG node returned by the
respective "get_dag" includes the data that can be parsed from such a
node ID. So svn_fs_base__dag_get_revision has to actually do work to
find the revision (since the ID never contains a straight-up revision
number), whereas svn_fs_fs__dag_get_revision just has to look at the
rev field that it's already parsed... and which is SVN_INVALID_REVNUM
for transactions.

And that's as far as I got. Questions:

* Who's right, BDB or FSFS? I assume BDB since its result doesn't lead
  to the dirprop conflict bug.

* Is the problem that FSFS's get_dag ought to be doing more work to
  find the revision of the transaction, or is that
  svn_fs_fs__dag_get_revision should be doing more work?

-- 
David Glasser | glasser_at_mit.edu | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Sep 11 08:14:18 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.