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

BDB: implementing 'upgrade' for fs-successor-ids

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Tue, 20 Sep 2011 16:38:33 +0300

To implement 'svnadmin upgrade' for fs-successor-ids, it seems we want
code to do the following:

  def construct_successors_in_existing_fs(fs):
    def handle_range(range):
      for revision in range:
        for node-rev-id in fs->revisions[revision]:
          Add to 'successors' table: key=fs->nodes[node-rev-id].pred-id value=node-rev-id

    For range in 0..999, 1000..1999, ..., N*1000..youngest:
      in a txn, handle_range(range)

    in a txn, handle_range( (old youngest)+1..[txn's value of "youngest"] )

Now, handle_range() needs to work with two tables at once --- reading
from NODES and writing to SUCCESSORS --- and I haven't found any
precedent in subversion/libsvn_fs_base/bdb/*.c for code that reads two
tables at once. (locks-table.c reads from bfd->lock_tokens, but it
doesn't read from bfd->locks in that function; and everything else only
reads from the table the file is named after.)

So, I'm asking what's the proper layout for this code: do I make
a function in bdb/successors-table.c that reads from NODES and writes to
SUCCESSORS? Or do I have a higher-level function (in, say, node-rev.c)
that runs within a txn, reading NODES and calling SUCCESSORS?

Thanks!

Daniel
Received on 2011-09-20 15:39:31 CEST

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.