subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1532084 - /subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c
Date Mon, 14 Oct 2013 20:44:47 GMT
Author: stefan2
Date: Mon Oct 14 20:44:47 2013
New Revision: 1532084

URL: http://svn.apache.org/r1532084
Log:
On the log-addressing branch:  Finalize the pack concurrency work.
All read code should now work fine in parallel to a background pack run.

This patch makes lets the index verification code retry a shard when
it got packed while being verified.

* subversion/libsvn_fs_fs/verify.c
  (verify_index_consistency): retry upon error if the pack size changed

Modified:
    subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c

Modified: subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c?rev=1532084&r1=1532083&r2=1532084&view=diff
==============================================================================
--- subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c (original)
+++ subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c Mon Oct 14 20:44:47
2013
@@ -621,21 +621,37 @@ verify_index_consistency(svn_fs_t *fs,
 
   for (revision = start; revision <= end; revision = pack_end)
     {
+      svn_error_t *err = SVN_NO_ERROR;
+
+      svn_revnum_t count = pack_size(fs, revision);
       pack_start = packed_base_rev(fs, revision);
-      pack_end = pack_start + pack_size(fs, revision);
+      pack_end = pack_start + count;
 
       if (notify_func && (pack_start % ffd->max_files_per_dir == 0))
         notify_func(pack_start, notify_baton, iterpool);
 
       /* two-way index check */
-      SVN_ERR(compare_l2p_to_p2l_index(fs, pack_start, pack_end - pack_start,
-                                       cancel_func, cancel_baton, iterpool));
-      SVN_ERR(compare_p2l_to_l2p_index(fs, pack_start, pack_end - pack_start,
-                                       cancel_func, cancel_baton, iterpool));
+      err = compare_l2p_to_p2l_index(fs, pack_start, pack_end - pack_start,
+                                     cancel_func, cancel_baton, iterpool);
+      if (!err)
+        err = compare_p2l_to_l2p_index(fs, pack_start, pack_end - pack_start,
+                                       cancel_func, cancel_baton, iterpool);
 
       /* verify in-index checksums and types vs. actual rev / pack files */
-      SVN_ERR(compare_p2l_to_rev(fs, pack_start, pack_end - pack_start,
-                                 cancel_func, cancel_baton, iterpool));
+      if (!err)
+        err = compare_p2l_to_rev(fs, pack_start, pack_end - pack_start,
+                                 cancel_func, cancel_baton, iterpool);
+
+      /* retry the whole shard if it got packed in the meantime */
+      if (err && count != pack_size(fs, revision))
+        {
+          svn_error_clear(err);
+          pack_end = pack_start;
+        }
+      else
+        {
+          SVN_ERR(err);
+        }
 
       svn_pool_clear(iterpool);
     }



Mime
View raw message