You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ko...@apache.org on 2016/01/08 13:38:43 UTC

svn commit: r1723720 - /subversion/trunk/subversion/libsvn_fs_fs/caching.c

Author: kotkov
Date: Fri Jan  8 12:38:42 2016
New Revision: 1723720

URL: http://svn.apache.org/viewvc?rev=1723720&view=rev
Log:
Make mod_dav_svn actually use the FSFS transaction directory cache during
series of PUT requests.

Prior to this changeset, we were adding a uuid to the cache prefix,
and that prevented mod_dav_svn from reusing the cache between two PUT
requests, i.e., after reopening the filesystem / getting the transaction
root.  We only need to insert the uuid for older filesystem formats that
don't track the global transaction ID via db/txn-current file.

* subversion/libsvn_fs_fs/caching.c
  (svn_fs_fs__initialize_txn_caches): Don't use a uuid in the cache prefix
   for newer filesystem formats.

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

Modified: subversion/trunk/subversion/libsvn_fs_fs/caching.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/caching.c?rev=1723720&r1=1723719&r2=1723720&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/caching.c Fri Jan  8 12:38:42 2016
@@ -849,16 +849,26 @@ svn_fs_fs__initialize_txn_caches(svn_fs_
 
   /* Transaction content needs to be carefully prefixed to virtually
      eliminate any chance for conflicts. The (repo, txn_id) pair
-     should be unique but if a transaction fails, it might be possible
-     to start a new transaction later that receives the same id.
-     Therefore, throw in a uuid as well - just to be sure. */
-  prefix = apr_pstrcat(pool,
-                       "fsfs:", fs->uuid,
-                       "/", fs->path,
-                       ":", txn_id,
-                       ":", svn_uuid_generate(pool),
-                       ":", "TXNDIR",
-                       SVN_VA_NULL);
+     should be unique but if the filesystem format doesn't store the
+     global transaction ID via the txn-current file, and a transaction
+     fails, it might be possible to start a new transaction later that
+     receives the same id.  For such older formats, throw in an uuid as
+     well -- just to be sure. */
+  if (ffd->format >= SVN_FS_FS__MIN_TXN_CURRENT_FORMAT)
+    prefix = apr_pstrcat(pool,
+                         "fsfs:", fs->uuid,
+                         "/", fs->path,
+                         ":", txn_id,
+                         ":", "TXNDIR",
+                         SVN_VA_NULL);
+  else
+    prefix = apr_pstrcat(pool,
+                         "fsfs:", fs->uuid,
+                         "/", fs->path,
+                         ":", txn_id,
+                         ":", svn_uuid_generate(pool),
+                         ":", "TXNDIR",
+                         SVN_VA_NULL);
 
   /* create a txn-local directory cache */
   SVN_ERR(create_cache(&ffd->txn_dir_cache,