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

Re: Node origins cache rewrite

From: David Glasser <glasser_at_davidglasser.net>
Date: Fri, 25 Jan 2008 12:50:22 -0800

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?

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, just for the hell of it. 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 1.5 adds "svnadmin recover" to FSFS which fixes the two ***
*** of current that were removed here; this code has not been ***
*** updated. ***

* subversion/libsvn_fs_fs/fs.h

* subversion/libsvn_fs_fs/fs_fs.c
  (path_node_origin): Remove.
  (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.
  (svn_fs_fs__ensure_dir_exists): Move back to lock.c (where it was
   before r29018).
  (svn_fs_fs__get_node_origin, set_node_origin,
   svn_fs_fs__set_node_origins, svn_fs_fs__set_node_origin): Remove.

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__ensure_dir_exists, svn_fs_fs__set_node_origin,
   svn_fs_fs__set_node_origins, svn_fs_fs__get_node_origin): Remove.

* subversion/libsvn_fs_fs/lock.c
  (ensure_dir_exists): Move this back here (reverting r29018).
  (write_digest_file): Adjust.

* subversion/libsvn_fs_fs/structure
  Remove references to node origin cache. Describe new node-ID

* subversion/libsvn_fs_fs/tree.c
  (fs_node_origin_rev): Remove use of cache. If the node-ID contains
   a '-', return the number after it.

David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org

Received on 2008-01-25 21:51:00 CET

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