Author: danielsh
Date: Thu Jun 30 20:18:18 2011
New Revision: 1141699
URL: http://svn.apache.org/viewvc?rev=1141699&view=rev
Log:
Document revprop packing in the FSFS 'structure' file, and correctly identify
an error condition as a corrupt filesystem rather than bogusly claiming a
non-existent revision had been encountered.
Discussed with: philip
* subversion/libsvn_fs_fs/fs_fs.c
(revision_proplist): When a packed-revprops revision isn't in revprops.db,
report SVN_ERR_FS_CORRUPT.
* subversion/libsvn_fs_fs/structure
(Packing revision properties): New section.
(Packing revisions): Renamed from 'Packing'.
(): Minor edits throughout.
Modified:
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
subversion/trunk/subversion/libsvn_fs_fs/structure
Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1141699&r1=1141698&r2=1141699&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Thu Jun 30 20:18:18 2011
@@ -3130,8 +3130,9 @@ revision_proplist(apr_hash_t **proplist_
SVN_ERR(svn_sqlite__bind_int64(stmt, 1, rev));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
if (!have_row)
- return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
- _("No such revision %ld"), rev);
+ return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
+ _("Missing %ld line in %s"),
+ rev, PATH_REVPROPS_DB);
SVN_ERR(svn_sqlite__column_properties(&proplist, stmt, 0, pool, pool));
SVN_ERR(svn_sqlite__reset(stmt));
Modified: subversion/trunk/subversion/libsvn_fs_fs/structure
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/structure?rev=1141699&r1=1141698&r2=1141699&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/structure (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/structure Thu Jun 30 20:18:18 2011
@@ -40,6 +40,7 @@ repository) is:
revprops/ Subdirectory containing rev-props
<shard>/ Shard directory, if sharding is in use (see below)
<revnum> File containing rev-props for <revnum>
+ revprops.db SQLite database of the packed revision properties
transactions/ Subdirectory containing transactions
<txnid>.txn/ Directory containing transaction <txnid>
txn-protorevs/ Subdirectory containing transaction proto-revision files
@@ -61,7 +62,6 @@ repository) is:
min-unpacked-rev File containing the oldest revision not in a pack file
min-unpacked-revprop File containing the oldest revision of unpacked revprop
rep-cache.db SQLite database mapping rep checksums to locations
- revprops.db SQLite database of the packed revision properties
Files in the revprops directory are in the hash dump format used by
svn_hash_write.
@@ -171,6 +171,8 @@ Revision changed paths list:
Format 1-3: Does not contain the node's kind.
Format 4-5: Contains the node's kind.
+# Incomplete list. See SVN_FS_FS__MIN_*_FORMAT
+
Filesystem format options
-------------------------
@@ -205,10 +207,10 @@ The known layouts, and the parameters th
revs/0/ directory will contain revisions 0-999, revs/1/ will contain
1000-1999, and so on.
-Packing
--------
+Packing revisions
+-----------------
-A repository can optionally be "packed" to conserve space on disk. The
+A filesystem can optionally be "packed" to conserve space on disk. The
packing process concatenates all the revision files in each full shard to
create pack files. A manifest file is also created for each shard which
records the indexes of the corresponding revision files in the pack file.
@@ -219,6 +221,18 @@ The manifest file consists of a list of
pack file. The offsets are stored as ASCII decimal, and separated by a newline
character.
+Packing revision properties
+---------------------------
+
+Revprop shards may be packed too. The packing process moves all revprops from
+a the oldest unpacked shard to the SQLite database "revprops/revprops.db". The
+sequel documents the schema of FSFS format 5, which corresponds to schema
+version USER_VERSION=1:
+
+The database maps revision numbers to serialized "proplist" skels. Every
+packed revision must have a mapping entry (a table row), even if it maps the
+revnum to an empty skel.
+
Node-revision IDs
-----------------