You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/05/08 16:12:29 UTC
svn commit: r1335543 - in /subversion/trunk/subversion: libsvn_fs_fs/fs_fs.c
tests/cmdline/svnadmin_tests.py
Author: stsp
Date: Tue May 8 14:12:29 2012
New Revision: 1335543
URL: http://svn.apache.org/viewvc?rev=1335543&view=rev
Log:
During FSFS hotcopy, create a revprop-generation file in the destination
if the source has one. A new revprop cache namespace is forced for the
destination because the hotcopy operation cannot reliably detect which
generation of revprops it has copied.
* subversion/libsvn_fs_fs/fs_fs.c
(hotcopy_body): Create a revprop-generation file in the destination
filesystem, with a value of zero, if such a file exists in the source.
* subversion/tests/cmdline/svnadmin_tests.py
(check_hotcopy_fsfs): Ensure that the revprop-generation file in the
hotcopy destination has a value of zero.
(hotcopy_dot, hotcopy_incremental,
hotcopy_incremental_packed): Remove XFail marker.
Modified:
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
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=1335543&r1=1335542&r2=1335543&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Tue May 8 14:12:29 2012
@@ -9199,6 +9199,15 @@ hotcopy_body(void *baton, apr_pool_t *po
SVN_ERR(svn_io_dir_file_copy(src_fs->path, dst_fs->path,
PATH_TXN_CURRENT, pool));
+ /* If a revprop generation file exists in the source filesystem,
+ * force a fresh revprop caching namespace for the destination by
+ * setting the generation to zero. We have no idea if the revprops
+ * we copied above really belong to the currently cached generation. */
+ SVN_ERR(svn_io_check_path(path_revprop_generation(src_fs, pool),
+ &kind, pool));
+ if (kind == svn_node_file)
+ SVN_ERR(write_revprop_generation_file(dst_fs, 0, pool));
+
/* Hotcopied FS is complete. Stamp it with a format file. */
SVN_ERR(write_format(svn_dirent_join(dst_fs->path, PATH_FORMAT, pool),
dst_ffd->format, max_files_per_dir, TRUE, pool));
Modified: subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py?rev=1335543&r1=1335542&r2=1335543&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py Tue May 8 14:12:29 2012
@@ -103,6 +103,16 @@ def check_hotcopy_fsfs(src, dst):
% (row, rows1[i]))
continue
+ # Special case for revprop-generation: It will always be zero in
+ # the hotcopy destination (i.e. a fresh cache generation)
+ if src_file == 'revprop-generation':
+ f2 = open(dst_path, 'r')
+ revprop_gen = int(f2.read().strip())
+ if revprop_gen != 0:
+ raise svntest.Failure("Hotcopy destination has non-zero " +
+ "revprop generation")
+ continue
+
f1 = open(src_path, 'r')
f2 = open(dst_path, 'r')
while True:
@@ -427,7 +437,6 @@ def dump_quiet(sbox):
#----------------------------------------------------------------------
-@XFail(svntest.main.is_fs_type_fsfs)
def hotcopy_dot(sbox):
"'svnadmin hotcopy PATH .'"
sbox.build()
@@ -1598,7 +1607,6 @@ def load_ranges(sbox):
expected_dump, new_dumpdata)
@SkipUnless(svntest.main.is_fs_type_fsfs)
-@XFail(svntest.main.is_fs_type_fsfs)
def hotcopy_incremental(sbox):
"'svnadmin hotcopy --incremental PATH .'"
sbox.build()
@@ -1622,7 +1630,6 @@ def hotcopy_incremental(sbox):
sbox.simple_commit()
@SkipUnless(svntest.main.is_fs_type_fsfs)
-@XFail(svntest.main.is_fs_type_fsfs)
def hotcopy_incremental_packed(sbox):
"'svnadmin hotcopy --incremental' with packing"
sbox.build()