subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1719884 - /subversion/branches/parallel-put/subversion/libsvn_fs_fs/tree.c
Date Mon, 14 Dec 2015 12:09:32 GMT
Author: stefan2
Date: Mon Dec 14 12:09:32 2015
New Revision: 1719884

URL: http://svn.apache.org/viewvc?rev=1719884&view=rev
Log:
On the parallel-put branch:
Disable DAG node caching in concurrent mode transactions.

During the tree modification phase, nodes that only have text or prop
changes will not be reported and their respective paths remain untouched
until the contents change comes in.  So, these paths become mutable as
part of the change - which invalidates everybodies DAG information.

* subversion/libsvn_fs_fs/tree.c
  (dag_node_cache_get,
   dag_node_cache_set,
   dag_node_cache_invalidate): Effectively become a no-op if there is
                               no L2 DAG cache.
  (make_txn_root): Create the L2 DAG cache only in non-concurrent txns.

Modified:
    subversion/branches/parallel-put/subversion/libsvn_fs_fs/tree.c

Modified: subversion/branches/parallel-put/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_fs_fs/tree.c?rev=1719884&r1=1719883&r2=1719884&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_fs_fs/tree.c Mon Dec 14 12:09:32 2015
@@ -444,11 +444,13 @@ dag_node_cache_get(dag_node_t **node_p,
       if (node == NULL)
         {
           locate_cache(&cache, &key, root, path, pool);
-          SVN_ERR(svn_cache__get((void **)&node, &found, cache, key, pool));
-          if (found && node)
+          if (cache)
+            SVN_ERR(svn_cache__get((void **)&node, &found, cache, key, pool));
+
+          if (node && found)
             {
-              /* Patch up the FS, since this might have come from an old FS
-               * object. */
+              /* Patch up the FS, since this might have come from an old
+               * FS object. */
               svn_fs_fs__dag_set_fs(node, root->fs);
 
               /* Retain the DAG node in L1 cache. */
@@ -467,8 +469,10 @@ dag_node_cache_get(dag_node_t **node_p,
 
       locate_cache(&cache, &key, root, path, pool);
 
-      SVN_ERR(svn_cache__get((void **) &node, &found, cache, key, pool));
-      if (found && node)
+      if (cache)
+        SVN_ERR(svn_cache__get((void **) &node, &found, cache, key, pool));
+
+      if (node && found)
         {
           /* Patch up the FS, since this might have come from an old FS
            * object. */
@@ -495,7 +499,8 @@ dag_node_cache_set(svn_fs_root_t *root,
   SVN_ERR_ASSERT(*path == '/');
 
   locate_cache(&cache, &key, root, path, pool);
-  return svn_cache__set(cache, key, node, pool);
+  return cache ? svn_cache__set(cache, key, node, pool)
+               : SVN_NO_ERROR;
 }
 
 
@@ -543,7 +548,8 @@ dag_node_cache_invalidate(svn_fs_root_t
 
   SVN_ERR_ASSERT(root->is_txn_root);
   locate_cache(&cache, NULL, root, NULL, b.pool);
-
+  if (!cache)
+    return SVN_NO_ERROR;
 
   SVN_ERR(svn_cache__iter(NULL, cache, find_descendants_in_cache,
                           &b, b.pool));
@@ -4419,6 +4425,7 @@ make_txn_root(svn_fs_root_t **root_p,
               apr_uint32_t flags,
               apr_pool_t *pool)
 {
+  fs_fs_data_t *ffd = fs->fsap_data;
   svn_fs_root_t *root = make_root(fs, pool);
   fs_txn_root_data_t *frd = apr_pcalloc(root->pool, sizeof(*frd));
   frd->txn_id = *txn;
@@ -4433,14 +4440,15 @@ make_txn_root(svn_fs_root_t **root_p,
 
      Note that since dag_node_cache_invalidate uses svn_cache__iter,
      this *cannot* be a memcache-based cache.  */
-  SVN_ERR(svn_cache__create_inprocess(&(frd->txn_node_cache),
-                                      svn_fs_fs__dag_serialize,
-                                      svn_fs_fs__dag_deserialize,
-                                      APR_HASH_KEY_STRING,
-                                      32, 20, FALSE,
-                                      apr_pstrcat(pool, txn, ":TXN",
-                                                  SVN_VA_NULL),
-                                      root->pool));
+  if (!ffd->concurrent_txns)
+    SVN_ERR(svn_cache__create_inprocess(&(frd->txn_node_cache),
+                                        svn_fs_fs__dag_serialize,
+                                        svn_fs_fs__dag_deserialize,
+                                        APR_HASH_KEY_STRING,
+                                        32, 20, FALSE,
+                                        apr_pstrcat(pool, txn, ":TXN",
+                                                    SVN_VA_NULL),
+                                        root->pool));
 
   /* Initialize transaction-local caches in FS.
 



Mime
View raw message