On Jan 25, 2008 12:50 PM, David Glasser <glasser_at_davidglasser.net> wrote:
> On Jan 25, 2008 11:16 AM, David Glasser <glasser_at_davidglasser.net> wrote:
> > On Jan 24, 2008 6:54 PM, Mark Phippard <markphip_at_gmail.com> wrote:
> > > I see David has rewritten this to no longer use SQLite. Yay!
> > Here's an alternative implementation. In FSFS, at commit time, new
> > node IDs are rewritten from a temporary value like "_ab3" to a unique
> > value by adding "ab3" to the "start_node_id" field in the current
> > file. This makes them not only unique, but also part of an ordered
> > sequence without gaps.
> > Is it actually important that node IDs be ordered and gapless? We
> > could just change new node-IDs (in format 3 repositories) to be built
> > as "<rev>-ab3". get-node-origin-rev would be trivial on these nodes.
> > Pre-format-3 repositories, or nodes in format 3 repositories that
> > aren't dumped and loaded, would require the slow crawl.
> Like this. Can somebody review?
New version, supporting "svnadmin recover". Barring objections, will
commit later today.
In FSFS, instead of having a node-origin cache on disk, just change
the node-id to contain the node-origin-rev.
That is, instead of (at commit finalization time) rewriting node IDs
based on a node ID counter in the "current" file, rewrite them as
"<base36>-<rev>". Do the same for copy IDs, for consistency. Do this
only in Format 3.
Now svn_fs_node_origin_rev is a trivial "look in the node ID"
operation, unless you're in Format 2 or a repository sneakily upgraded
without a dump and load (not really supported anyway), in which case
you still do the history walk.
(svn_fs_fs__hotcopy): Don't copy node origins cache.
(write_final_rev): Depending on FS format, make new IDs either from
revnum or from counter. Remove node_origins hash parameter.
(write_current, write_final_current): Only write out node/copy IDs
for old formats.
(struct commit_baton): Remove node_origins hash.
(commit_body): Only read in node/copy IDs for old formats. Don't
pass node_origins hash to write_final_rev.
(svn_fs_fs__commit): Remove post-commit node origins cache update.
(svn_fs_fs__create): Don't write initial values of node/copy ID
counters for new file format.
(recover_body): Only calculate maximum node/copy IDs in the
repository for old formats.
(svn_fs_fs__ensure_dir_exists): Move back to lock.c (where it was
svn_fs_fs__set_node_origins, svn_fs_fs__set_node_origin): Remove.
svn_fs_fs__set_node_origins, svn_fs_fs__get_node_origin): Remove.
(ensure_dir_exists): Move this back here (reverting r29018).
Remove references to node origin cache. Describe new node-ID
(fs_node_origin_rev): Remove use of cache. If the node-ID contains
a '-', return the number after it.
David Glasser | email@example.com | http://www.davidglasser.net/
Received on 2008-01-28 18:55:48 CET
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org