You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2010/11/10 19:12:16 UTC
svn commit: r1033625 - in /subversion/trunk/subversion: libsvn_fs_fs/fs_fs.c
tests/libsvn_fs_fs/fs-pack-test.c
Author: cmpilato
Date: Wed Nov 10 18:12:16 2010
New Revision: 1033625
URL: http://svn.apache.org/viewvc?rev=1033625&view=rev
Log:
Fix issue #3571 ("fsfs 'svnadmin recover' expects youngest revprop to
be outside revprops.db").
* subversion/libsvn_fs_fs/fs_fs.c
(recover_body): Don't flag a missing youngest revprop file as a problem
if we've reason to believe that revision's props have been packed
into the revprops.db database.
* subversion/tests/libsvn_fs_fs/fs-pack-test.c
(test_funcs): Now expect recover_fully_packed() to pass.
Modified:
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
subversion/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c
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=1033625&r1=1033624&r2=1033625&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Wed Nov 10 18:12:16 2010
@@ -6924,15 +6924,41 @@ recover_body(void *baton, apr_pool_t *po
SVN_ERR(svn_io_check_path(path_revprops(fs, max_rev, pool),
&youngest_revprops_kind, pool));
if (youngest_revprops_kind == svn_node_none)
- return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
- _("Revision %ld has a revs file but no "
- "revprops file"),
- max_rev);
+ {
+ svn_boolean_t uhohs = TRUE;
+
+ /* No file? Hrm... maybe that's because this repository is
+ packed and the youngest revision is in the revprops.db
+ file? We can at least see if that's a possibility.
+
+ ### TODO: Could we check for revprops in the revprops.db?
+ ### What if rNNN legitimately has no revprops? */
+ if (ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
+ {
+ svn_revnum_t min_unpacked_revprop;
+ const char *min_unpacked_revprop_path =
+ svn_dirent_join(fs->path, PATH_MIN_UNPACKED_REVPROP, pool);
+
+ SVN_ERR(read_min_unpacked_rev(&min_unpacked_revprop,
+ min_unpacked_revprop_path, pool));
+ if (min_unpacked_revprop == (max_rev + 1))
+ uhohs = FALSE;
+ }
+ if (uhohs)
+ {
+ return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
+ _("Revision %ld has a revs file but no "
+ "revprops file"),
+ max_rev);
+ }
+ }
else if (youngest_revprops_kind != svn_node_file)
- return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
- _("Revision %ld has a non-file where its "
- "revprops file should be"),
- max_rev);
+ {
+ return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
+ _("Revision %ld has a non-file where its "
+ "revprops file should be"),
+ max_rev);
+ }
/* Now store the discovered youngest revision, and the next IDs if
relevant, in a new 'current' file. */
Modified: subversion/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c?rev=1033625&r1=1033624&r2=1033625&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c Wed Nov 10 18:12:16 2010
@@ -484,7 +484,7 @@ struct svn_test_descriptor_t test_funcs[
"commit to a packed FSFS filesystem"),
SVN_TEST_OPTS_PASS(get_set_revprop_packed_fs,
"get/set revprop while packing FSFS filesystem"),
- SVN_TEST_OPTS_XFAIL(recover_fully_packed,
- "recover a fully packed filesystem"),
+ SVN_TEST_OPTS_PASS(recover_fully_packed,
+ "recover a fully packed filesystem"),
SVN_TEST_NULL
};