subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1756266 - /subversion/trunk/subversion/libsvn_fs_fs/transaction.c
Date Sat, 13 Aug 2016 13:18:57 GMT
Author: ivan
Date: Sat Aug 13 13:18:57 2016
New Revision: 1756266

URL: http://svn.apache.org/viewvc?rev=1756266&view=rev
Log:
FSFS: Write the sha1->rep mapping in transaction *after* we successfully
written node revision to disk. Otherwise may get orphaned sha1->rep mapping
entry if an error occurs when writing p2l index entry.

* subversion/libsvn_fs_fs/transaction.c
  (rep_write_contents_close): Call store_sha1_rep_mapping() after we
   successfully written node revision to disk and closed proto-revision file.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/transaction.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1756266&r1=1756265&r2=1756266&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Sat Aug 13 13:18:57 2016
@@ -2485,12 +2485,17 @@ rep_write_contents_close(void *baton)
                                       b->fnv1a_checksum_ctx,
                                       b->scratch_pool));
 
-      SVN_ERR(store_sha1_rep_mapping(b->fs, b->noderev, b->scratch_pool));
       SVN_ERR(store_p2l_index_entry(b->fs, &rep->txn_id, &entry,
                                     b->scratch_pool));
     }
 
   SVN_ERR(svn_io_file_close(b->file, b->scratch_pool));
+
+  /* Write the sha1->rep mapping *after* we successfully written node
+   * revision to disk. */
+  if (!old_rep)
+    SVN_ERR(store_sha1_rep_mapping(b->fs, b->noderev, b->scratch_pool));
+
   SVN_ERR(unlock_proto_rev(b->fs, &rep->txn_id, b->lockcookie,
                            b->scratch_pool));
   svn_pool_destroy(b->scratch_pool);



Mime
View raw message