Author: julianfoad
Date: Wed Jul 7 10:06:29 2010
New Revision: 961331
URL: http://svn.apache.org/viewvc?rev=961331&view=rev
Log:
* notes/wc-ng/single-db-per-wc
Update based on Greg's email reply.
Modified:
subversion/trunk/notes/wc-ng/single-db-per-wc
Modified: subversion/trunk/notes/wc-ng/single-db-per-wc
URL:
http://svn.apache.org/viewvc/subversion/trunk/notes/wc-ng/single-db-per-wc?rev=961331&r1=961330&r2=961331&view=diff
==============================================================================
--- subversion/trunk/notes/wc-ng/single-db-per-wc (original)
+++ subversion/trunk/notes/wc-ng/single-db-per-wc Wed Jul 7 10:06:29 2010
@@ -18,77 +18,88 @@ Current test results (r960984):
Crash.
-Upgrade: Migration of DB tables from subdir DBs to root DB
-==========================================================
+Upgrade: Migration of DB tables from subdir DBs to wcroot 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.
+"Move into wcroot's table" means move each row into the same table in the WC
+root's DB; we expect the primary key to be unique - not already in the
+wcroot table.
REPOSITORY
- Merge into root's table, which may result in assigning new id's.
+ Merge into wcroot's table:
+ move the row into the wcroot's REPOSITORY table, unless a row that's
+ identical (apart from its id) is already present, in which case take the
+ existing wcroot row's id.
+
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.
+ Note: The existence of more than one repository id in a working copy
+ arises when "svn switch --relocate" is used. A new repository table row
+ is created, with the new repository URL and a new id (say repos_id = 2).
+ Any new versioned directories that are created after that have the new
+ repository URL but with repos-id = 1. Hence the need to merge the tables.
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.
+ Ignore this table. (It always has just one row, with a default id and a
+ null local_abspath.)
BASE_NODE
- Move into root's table;
+ Move into wcroot's table;
omit if .kind == subdir
change .local_relpath
set .parent_relpath
WORKING_NODE
- Move into root's table;
+ Move into wcroot's table;
omit if .kind == subdir (?)
change .local_relpath
set .parent_relpath
+ Note from Greg:
+ Generally, ignoring subdir might be okay in these two tables [BASE_NODE,
+ WORKING_NODE], but the not-present value is used/important.
+
ACTUAL_NODE
- Move into root's table;
+ Move into wcroot's table;
change .local_relpath
set .parent_relpath
LOCK
- Move into root's table.
+ Move into wcroot'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
+ Move into wcroot's table.
+ Move the corresponding pristine text files into wcroot's 'pristine' dir.
+ Change wcroot's pristine directory to sharded (or this could be a
separate upgrade).
WC_LOCK
- Move into root's table;
- change .local_dir_relpath
+ Ignore this table. (Ensure it is empty. If not, 'svn cleanup' should be
+ run.)
WORK_QUEUE
- Ensure WORK_QUEUE is empty.
+ Ignore this table. (Ensure it is empty. If not, 'svn cleanup' should be
+ run.)
Code Changes Required
=====================
+ Greg says: An area to examine is all of the uses of db_status_obstructed,
+ db_status_obstructed_(add|delete). Those should not occur in single-db, so
+ anything that sets those status values or checks for them is suspect. (I'd
+ #ifdef them away, for example, then patch all references).