Author: svn-role
Date: Wed Nov 19 04:00:25 2014
New Revision: 1640479

URL: http://svn.apache.org/r1640479
Log:
Merge the 1.8.x-r1619774 branch:

 * r1543594, r1619774, r1619105, r1619118, r1619153, r1619802
   Disable the revprop caching feature.
   Justification:
     The deployment restrictions that come with the 1.8 implementation
     of this feature make it hard to use correctly. See also
     http://svn.haxx.se/dev/archive-2014-08/0273.shtml
   Notes:
     r1619774 is the actual patch, r1543594 is a whitespace only change
     that prevents a text conflict.  r1619105, r1619118, r1619153 and
     r1619802 provide a new test case.  This required the backport branch
     since the test file has been renamed on /trunk and used 1.9 APIs.
   Branch:
     ^/subversion/branches/1.8.x-r1619774
   Votes:
     +1: stefan2, ivan, rhuijben

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_fs_fs/caching.c
    subversion/branches/1.8.x/subversion/tests/libsvn_fs_fs/fs-pack-test.c

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1543594,1619105,1619118,1619153,1619774,1619802
  Merged /subversion/branches/1.8.x-r1619774:r1626728-1640478

Modified: subversion/branches/1.8.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1640479&r1=1640478&r2=1640479&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Wed Nov 19 04:00:25 2014
@@ -206,22 +206,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1543594, r1619774, r1619105, r1619118, r1619153, r1619802
-   Disable the revprop caching feature.
-   Justification:
-     The deployment restrictions that come with the 1.8 implementation
-     of this feature make it hard to use correctly. See also
-     http://svn.haxx.se/dev/archive-2014-08/0273.shtml
-   Notes:
-     r1619774 is the actual patch, r1543594 is a whitespace only change
-     that prevents a text conflict.  r1619105, r1619118, r1619153 and
-     r1619802 provide a new test case.  This required the backport branch
-     since the test file has been renamed on /trunk and used 1.9 APIs.
-   Branch:
-     ^/subversion/branches/1.8.x-r1619774
-   Votes:
-     +1: stefan2, ivan, rhuijben
-
  * r1561426
    In FSFS, skip the generation of uniquifiers if rep-shared is not supported.
    Branch: ^/subversion/branches/1.8.x-r1561426

Modified: subversion/branches/1.8.x/subversion/libsvn_fs_fs/caching.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_fs_fs/caching.c?rev=1640479&r1=1640478&r2=1640479&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_fs_fs/caching.c Wed Nov 19 
04:00:25 2014
@@ -89,7 +89,7 @@ read_config(svn_memcache_t **memcache_p,
   fs_fs_data_t *ffd = fs->fsap_data;
 
   SVN_ERR(svn_cache__make_memcache_from_config(memcache_p, ffd->config,
-                                              fs->pool));
+                                               fs->pool));
 
   /* No cache namespace by default.  I.e. all FS instances share the
    * cached data.  If you specify different namespaces, the data will
@@ -129,23 +129,9 @@ read_config(svn_memcache_t **memcache_p,
                          SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS,
                          TRUE);
 
-  /* don't cache revprops by default.
-   * Revprop caching significantly speeds up operations like
-   * svn ls -v. However, it requires synchronization that may
-   * not be available or efficient in the current server setup.
-   *
-   * If the caller chose option "2", enable revprop caching if
-   * the required API support is there to make it efficient.
+  /* For now, always disable revprop caching.
    */
-  if (strcmp(svn_hash__get_cstring(fs->config,
-                                   SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
-                                   ""), "2"))
-    *cache_revprops
-      = svn_hash__get_bool(fs->config,
-                          SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
-                          FALSE);
-  else
-    *cache_revprops = svn_named_atomic__is_efficient();
+  *cache_revprops = FALSE;
 
   return svn_config_get_bool(ffd->config, fail_stop,
                              CONFIG_SECTION_CACHES, CONFIG_OPTION_FAIL_STOP,

Modified: subversion/branches/1.8.x/subversion/tests/libsvn_fs_fs/fs-pack-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/libsvn_fs_fs/fs-pack-test.c?rev=1640479&r1=1640478&r2=1640479&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/libsvn_fs_fs/fs-pack-test.c 
(original)
+++ subversion/branches/1.8.x/subversion/tests/libsvn_fs_fs/fs-pack-test.c Wed 
Nov 19 04:00:25 2014
@@ -38,6 +38,16 @@
 
 /*** Helper Functions ***/
 
+static void
+ignore_fs_warnings(void *baton, svn_error_t *err)
+{
+#ifdef SVN_DEBUG
+  SVN_DBG(("Ignoring FS warning %s\n",
+           svn_error_symbolic_name(err ? err->apr_err : 0)));
+#endif
+  return;
+}
+
 /* Write the format number and maximum number of files per directory
    to a new format file in PATH, overwriting a previously existing
    file.  Use POOL for temporary allocation.
@@ -857,6 +867,57 @@ get_set_multiple_huge_revprops_packed_fs
 #undef SHARD_SIZE
 
 /* ------------------------------------------------------------------------ */
+
+#define REPO_NAME "revprop_caching_on_off"
+static svn_error_t *
+revprop_caching_on_off(const svn_test_opts_t *opts,
+                       apr_pool_t *pool)
+{
+  svn_fs_t *fs1;
+  svn_fs_t *fs2;
+  apr_hash_t *fs_config;
+  svn_string_t *value;
+  const svn_string_t *another_value_for_avoiding_warnings_from_a_broken_api;
+  const svn_string_t *new_value = svn_string_create("new", pool);
+
+  if (strcmp(opts->fs_type, "fsfs") != 0)
+    return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL, NULL);
+
+  /* Open two filesystem objects, enable revision property caching
+   * in one of them. */
+  SVN_ERR(svn_test__create_fs(&fs1, REPO_NAME, opts, pool));
+
+  fs_config = apr_hash_make(pool);
+  apr_hash_set(fs_config, SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
+               APR_HASH_KEY_STRING, "1");
+
+  SVN_ERR(svn_fs_open(&fs2, svn_fs_path(fs1, pool), fs_config, pool));
+
+  /* With inefficient named atomics, the filesystem will output a warning
+     and disable the revprop caching, but we still would like to test
+     these cases.  Ignore the warning(s). */
+  svn_fs_set_warning_func(fs2, ignore_fs_warnings, NULL);
+
+  SVN_ERR(svn_fs_revision_prop(&value, fs2, 0, "svn:date", pool));
+  another_value_for_avoiding_warnings_from_a_broken_api = value;
+  SVN_ERR(svn_fs_change_rev_prop2(
+              fs1, 0, "svn:date",
+              &another_value_for_avoiding_warnings_from_a_broken_api,
+              new_value, pool));
+
+  /* Expect the change to be visible through both objects.*/
+  SVN_ERR(svn_fs_revision_prop(&value, fs1, 0, "svn:date", pool));
+  SVN_TEST_STRING_ASSERT(value->data, "new");
+
+  SVN_ERR(svn_fs_revision_prop(&value, fs2, 0, "svn:date", pool));
+  SVN_TEST_STRING_ASSERT(value->data, "new");
+
+  return SVN_NO_ERROR;
+}
+
+#undef REPO_NAME
+
+/* ------------------------------------------------------------------------ */
 
 /* The test table.  */
 
@@ -883,5 +944,7 @@ struct svn_test_descriptor_t test_funcs[
                        "test file hint at shard boundary"),
     SVN_TEST_OPTS_PASS(get_set_multiple_huge_revprops_packed_fs,
                        "set multiple huge revprops in packed FSFS"),
+    SVN_TEST_OPTS_PASS(revprop_caching_on_off,
+                       "change revprops with enabled and disabled caching"),
     SVN_TEST_NULL
   };


Reply via email to