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

How to migrate to Single DB per WC

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Tue, 06 Jul 2010 20:24:23 +0100

I've started looking at moving to a single DB per WC, and written some
notes in 'notes/wc-ng/single-db-per-wc'. I haven't looked into the
current state of the code yet, other than building it (success) and
running it (50% of tests pass, which isn't bad, considering).

Any comments on this "how to upgrade the DB tables" part (copied from
that document)?

[[[

Upgrade: Migration of DB tables from subdir DBs to root DB
==========================================================

"Move into root's table" means move each row into the same table in the WC
root's DB, and we expect no duplicates.

"Merge into root's table" means we move the row into the root's table,
unless a row that's identical apart from its id is already present, in which
case we use the existing row's id.

REPOSITORY

  Merge into root's table, which may result in assigning new id's.
  Change all repos id's accordingly in the other tables being migrated:
    BASE_NODE.repos_id
    WORKING_NODE.copyfrom_repos_id
    LOCK.repos_id
    # and in tree conflict info?

  Note: I already have two repos id's in some parts of some of my svn
  working copies, so this is not purely theoretical.

WCROOT

  Merge into root's table;
    theoretically we should assign new id's and change them where they
    appear in other tables, but in practice the id is always 1 so we can
    just assert that.

BASE_NODE

  Move into root's table;
    omit if .kind == subdir
    change .local_relpath
    set .parent_relpath

WORKING_NODE

  Move into root's table;
    omit if .kind == subdir (?)
    change .local_relpath
    set .parent_relpath

ACTUAL_NODE

  Move into root's table;
    change .local_relpath
    set .parent_relpath

LOCK
    
  Move into root's table.

PRISTINE

  Move into root's table.
  Move the corresponding pristine text files into root's 'pristine' dir.
  Change root's pristine directory to sharded (or this could be a
    separate upgrade).

WC_LOCK

  Move into root's table;
    change .local_dir_relpath

WORK_QUEUE

  Ensure WORK_QUEUE is empty.

]]]

- Julian
Received on 2010-07-06 21:25:08 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.