Author: stefan2
Date: Sun Aug 24 23:56:28 2014
New Revision: 1620242

URL: http://svn.apache.org/r1620242
Log:
On the revprop-caching-ng branch:  Improved crash recovery efficiency.

* subversion/libsvn_fs_fs/revprops.c
  (read_revprop_generation):  If the writer process is to discover another
                              crashed writer, we can recover immediately.

Modified:
    subversion/branches/revprop-caching-ng/subversion/libsvn_fs_fs/revprops.c

Modified: 
subversion/branches/revprop-caching-ng/subversion/libsvn_fs_fs/revprops.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-caching-ng/subversion/libsvn_fs_fs/revprops.c?rev=1620242&r1=1620241&r2=1620242&view=diff
==============================================================================
--- subversion/branches/revprop-caching-ng/subversion/libsvn_fs_fs/revprops.c 
(original)
+++ subversion/branches/revprop-caching-ng/subversion/libsvn_fs_fs/revprops.c 
Sun Aug 24 23:56:28 2014
@@ -522,15 +522,22 @@ read_revprop_generation(apr_int64_t *gen
   /* is an unfinished revprop write under the way? */
   if (current % 2)
     {
-      apr_time_t mtime;
-      SVN_ERR(svn_io_file_affected_time(&mtime,
-                       svn_fs_fs__path_revprop_generation(fs, scratch_pool),
-                       scratch_pool));
+      svn_boolean_t timeout = FALSE;
 
-      /* has the writer process been aborted,
-       * i.e. has the timeout been reached?
+      /* Has the writer process been aborted?
+       * Either by timeout or by us being the writer now.
        */
-      if (apr_time_now() > mtime + REVPROP_CHANGE_TIMEOUT)
+      if (!ffd->has_write_lock)
+        {
+          apr_time_t mtime;
+          SVN_ERR(svn_io_file_affected_time(&mtime,
+                          svn_fs_fs__path_revprop_generation(fs,
+                                                             scratch_pool),
+                          scratch_pool));
+          timeout = apr_time_now() > mtime + REVPROP_CHANGE_TIMEOUT;
+        }
+
+      if (ffd->has_write_lock || timeout)
         {
           revprop_generation_upgrade_t baton;
           baton.generation = &current;


Reply via email to