You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/04/05 19:43:13 UTC

svn commit: r1671407 - in /subversion/branches/fsx-1.10/subversion: libsvn_fs_x/fs.h libsvn_fs_x/hotcopy.c libsvn_fs_x/pack.c libsvn_fs_x/revprops.c libsvn_fs_x/revprops.h libsvn_fs_x/transaction.c libsvn_fs_x/util.c tests/libsvn_fs_x/fs-x-pack-test.c

Author: stefan2
Date: Sun Apr  5 17:43:12 2015
New Revision: 1671407

URL: http://svn.apache.org/r1671407
Log:
On the fsx-1.10 branch:
Merge revprops folder into the revs folder.

* subversion/libsvn_fs_x/fs.h
  (PATH_REVPROPS_DIR): That folder no longer exists.

* subversion/libsvn_fs_x/util.c
  (construct_shard_sub_path): Always the same parent directory.

* subversion/libsvn_fs_x/hotcopy.c
  (hotcopy_copy_packed_shard,
   hotcopy_revisions,
   hotcopy_body): No need to copy a separate revprop shard.

* subversion/libsvn_fs_x/pack.c
  (pack_shard): No separate revprop shard. Pack revprops unconditionally.
  (pack_body): Update caller.

* subversion/libsvn_fs_x/revprops.c
  (svn_fs_x__pack_revprops_shard): Don't manage the shard dir here b/c
                                   the common folder is already handled
                                   by the pack logic.
  (svn_fs_x__delete_revprops_shard): Remove.

* subversion/libsvn_fs_x/revprops.h
  (svn_fs_x__delete_revprops_shard): Remove.

* subversion/libsvn_fs_x/transaction.c
  (commit_body): Update path constructor.

* subversion/tests/libsvn_fs_x/fs-x-pack-test.c
  (recover_fully_packed): Same.

Modified:
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/fs.h
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/hotcopy.c
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/pack.c
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.h
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/transaction.c
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/util.c
    subversion/branches/fsx-1.10/subversion/tests/libsvn_fs_x/fs-x-pack-test.c

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/fs.h?rev=1671407&r1=1671406&r2=1671407&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/fs.h (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/fs.h Sun Apr  5 17:43:12 2015
@@ -56,7 +56,6 @@ extern "C" {
 #define PATH_LOCK_FILE        "write-lock"       /* Revision lock file */
 #define PATH_PACK_LOCK_FILE   "pack-lock"        /* Pack lock file */
 #define PATH_REVS_DIR         "revs"             /* Directory of revisions */
-#define PATH_REVPROPS_DIR     "revprops"         /* Directory of revprops */
 #define PATH_TXNS_DIR         "transactions"     /* Directory of transactions */
 #define PATH_NODE_ORIGINS_DIR "node-origins"     /* Lazy node-origin cache */
 #define PATH_TXN_PROTOS_DIR   "txn-protorevs"    /* Directory of proto-revs */

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/hotcopy.c?rev=1671407&r1=1671406&r2=1671407&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/hotcopy.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/hotcopy.c Sun Apr  5 17:43:12 2015
@@ -300,9 +300,6 @@ hotcopy_copy_packed_shard(svn_boolean_t
   const char *dst_subdir;
   const char *packed_shard;
   const char *src_subdir_packed_shard;
-  svn_revnum_t revprop_rev;
-  apr_pool_t *iterpool;
-  svn_fs_x__data_t *src_ffd = src_fs->fsap_data;
 
   /* Copy the packed shard. */
   src_subdir = svn_dirent_join(src_fs->path, PATH_REVS_DIR, scratch_pool);
@@ -317,41 +314,6 @@ hotcopy_copy_packed_shard(svn_boolean_t
                                           NULL /* cancel_func */, NULL,
                                           scratch_pool));
 
-  /* Copy revprops belonging to revisions in this pack. */
-  src_subdir = svn_dirent_join(src_fs->path, PATH_REVPROPS_DIR, scratch_pool);
-  dst_subdir = svn_dirent_join(dst_fs->path, PATH_REVPROPS_DIR, scratch_pool);
-
-  if (src_ffd->min_unpacked_rev < rev + max_files_per_dir)
-    {
-      /* copy unpacked revprops rev by rev */
-      iterpool = svn_pool_create(scratch_pool);
-      for (revprop_rev = rev;
-           revprop_rev < rev + max_files_per_dir;
-           revprop_rev++)
-        {
-          svn_pool_clear(iterpool);
-
-          SVN_ERR(hotcopy_copy_shard_file(skipped_p, src_subdir, dst_subdir,
-                                          revprop_rev, max_files_per_dir,
-                                          TRUE, iterpool));
-        }
-      svn_pool_destroy(iterpool);
-    }
-  else
-    {
-      /* packed revprops folder */
-      packed_shard = apr_psprintf(scratch_pool, "%ld" PATH_EXT_PACKED_SHARD,
-                                  rev / max_files_per_dir);
-      src_subdir_packed_shard = svn_dirent_join(src_subdir, packed_shard,
-                                                scratch_pool);
-      SVN_ERR(hotcopy_io_copy_dir_recursively(skipped_p,
-                                              src_subdir_packed_shard,
-                                              dst_subdir, packed_shard,
-                                              TRUE /* copy_perms */,
-                                              NULL /* cancel_func */, NULL,
-                                              scratch_pool));
-    }
-
   /* If necessary, update the min-unpacked rev file in the hotcopy. */
   if (*dst_min_unpacked_rev < rev + max_files_per_dir)
     {
@@ -415,8 +377,6 @@ hotcopy_revisions(svn_fs_t *src_fs,
                   svn_boolean_t incremental,
                   const char *src_revs_dir,
                   const char *dst_revs_dir,
-                  const char *src_revprops_dir,
-                  const char *dst_revprops_dir,
                   svn_fs_hotcopy_notify_t notify_func,
                   void* notify_baton,
                   svn_cancel_func_t cancel_func,
@@ -499,9 +459,6 @@ hotcopy_revisions(svn_fs_t *src_fs,
       SVN_ERR(svn_io_remove_dir2(svn_fs_x__path_rev_shard(dst_fs, rev,
                                                           iterpool),
                                  TRUE, cancel_func, cancel_baton, iterpool));
-      SVN_ERR(svn_io_remove_dir2(svn_fs_x__path_revprops_shard(dst_fs, rev,
-                                                               iterpool),
-                                 TRUE, cancel_func, cancel_baton, iterpool));
     }
 
   if (cancel_func)
@@ -539,8 +496,7 @@ hotcopy_revisions(svn_fs_t *src_fs,
                                       iterpool));
 
       /* Copy the revprop file. */
-      SVN_ERR(hotcopy_copy_shard_file(&skipped, src_revprops_dir,
-                                      dst_revprops_dir,
+      SVN_ERR(hotcopy_copy_shard_file(&skipped, src_revs_dir, dst_revs_dir,
                                       rev, max_files_per_dir, TRUE,
                                       iterpool));
 
@@ -610,8 +566,6 @@ hotcopy_body(void *baton,
   void* cancel_baton = hbb->cancel_baton;
   svn_revnum_t src_youngest;
   svn_revnum_t dst_youngest;
-  const char *src_revprops_dir;
-  const char *dst_revprops_dir;
   const char *src_revs_dir;
   const char *dst_revs_dir;
   const char *src_subdir;
@@ -651,16 +605,10 @@ hotcopy_body(void *baton,
 
   src_revs_dir = svn_dirent_join(src_fs->path, PATH_REVS_DIR, scratch_pool);
   dst_revs_dir = svn_dirent_join(dst_fs->path, PATH_REVS_DIR, scratch_pool);
-  src_revprops_dir = svn_dirent_join(src_fs->path, PATH_REVPROPS_DIR,
-                                     scratch_pool);
-  dst_revprops_dir = svn_dirent_join(dst_fs->path, PATH_REVPROPS_DIR,
-                                     scratch_pool);
 
   /* Ensure that the required folders exist in the destination
    * before actually copying the revisions and revprops. */
   SVN_ERR(svn_io_make_dir_recursively(dst_revs_dir, scratch_pool));
-  SVN_ERR(svn_io_make_dir_recursively(dst_revprops_dir, scratch_pool));
-
   if (cancel_func)
     SVN_ERR(cancel_func(cancel_baton));
 
@@ -670,7 +618,6 @@ hotcopy_body(void *baton,
    * revision number, but also the next-ID counters). */
   SVN_ERR(hotcopy_revisions(src_fs, dst_fs, src_youngest, dst_youngest,
                             incremental, src_revs_dir, dst_revs_dir,
-                            src_revprops_dir, dst_revprops_dir,
                             notify_func, notify_baton,
                             cancel_func, cancel_baton, scratch_pool));
   SVN_ERR(svn_fs_x__write_current(dst_fs, src_youngest, scratch_pool));

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/pack.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/pack.c?rev=1671407&r1=1671406&r2=1671407&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/pack.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/pack.c Sun Apr  5 17:43:12 2015
@@ -2123,11 +2123,9 @@ pack_rev_shard(svn_fs_t *fs,
   return SVN_NO_ERROR;
 }
 
-/* In the file system at FS_PATH, pack the SHARD in REVS_DIR and
- * REVPROPS_DIR containing exactly MAX_FILES_PER_DIR revisions, using
- * SCRATCH_POOL temporary for allocations.  REVPROPS_DIR will be NULL if
- * revprop packing is not supported.  COMPRESSION_LEVEL and MAX_PACK_SIZE
- * will be ignored in that case.
+/* In the file system at FS_PATH, pack the SHARD in DIR containing exactly
+ * MAX_FILES_PER_DIR revisions, using SCRATCH_POOL temporary for allocations.
+ * COMPRESSION_LEVEL and MAX_PACK_SIZE will be ignored in that case.
  *
  * CANCEL_FUNC and CANCEL_BATON are what you think they are; similarly
  * NOTIFY_FUNC and NOTIFY_BATON.
@@ -2136,8 +2134,7 @@ pack_rev_shard(svn_fs_t *fs,
  * remove the pack file and start again.
  */
 static svn_error_t *
-pack_shard(const char *revs_dir,
-           const char *revsprops_dir,
+pack_shard(const char *dir,
            svn_fs_t *fs,
            apr_int64_t shard,
            int max_files_per_dir,
@@ -2159,12 +2156,12 @@ pack_shard(const char *revs_dir,
                         scratch_pool));
 
   /* Some useful paths. */
-  rev_pack_file_dir = svn_dirent_join(revs_dir,
+  rev_pack_file_dir = svn_dirent_join(dir,
                   apr_psprintf(scratch_pool,
                                "%" APR_INT64_T_FMT PATH_EXT_PACKED_SHARD,
                                shard),
                   scratch_pool);
-  rev_shard_path = svn_dirent_join(revs_dir,
+  rev_shard_path = svn_dirent_join(dir,
                       apr_psprintf(scratch_pool, "%" APR_INT64_T_FMT, shard),
                       scratch_pool);
 
@@ -2173,27 +2170,24 @@ pack_shard(const char *revs_dir,
                          shard, max_files_per_dir, DEFAULT_MAX_MEM,
                          cancel_func, cancel_baton, scratch_pool));
 
-  /* if enabled, pack the revprops in an equivalent way */
-  if (revsprops_dir)
-    {
-      revprops_pack_file_dir = svn_dirent_join(revsprops_dir,
-                   apr_psprintf(scratch_pool,
-                                "%" APR_INT64_T_FMT PATH_EXT_PACKED_SHARD,
-                                shard),
-                   scratch_pool);
-      revprops_shard_path = svn_dirent_join(revsprops_dir,
-                   apr_psprintf(scratch_pool, "%" APR_INT64_T_FMT, shard),
-                   scratch_pool);
-
-      SVN_ERR(svn_fs_x__pack_revprops_shard(fs,
-                                            revprops_pack_file_dir,
-                                            revprops_shard_path,
-                                            shard, max_files_per_dir,
-                                            (int)(0.9 * max_pack_size),
-                                            compression_level,
-                                            cancel_func, cancel_baton,
-                                            scratch_pool));
-    }
+  /* pack the revprops in an equivalent way */
+  revprops_pack_file_dir = svn_dirent_join(dir,
+                apr_psprintf(scratch_pool,
+                            "%" APR_INT64_T_FMT PATH_EXT_PACKED_SHARD,
+                            shard),
+                scratch_pool);
+  revprops_shard_path = svn_dirent_join(dir,
+                apr_psprintf(scratch_pool, "%" APR_INT64_T_FMT, shard),
+                scratch_pool);
+
+  SVN_ERR(svn_fs_x__pack_revprops_shard(fs,
+                                        revprops_pack_file_dir,
+                                        revprops_shard_path,
+                                        shard, max_files_per_dir,
+                                        (int)(0.9 * max_pack_size),
+                                        compression_level,
+                                        cancel_func, cancel_baton,
+                                        scratch_pool));
 
   /* Update the min-unpacked-rev file to reflect our newly packed shard. */
   SVN_ERR(svn_fs_x__write_min_unpacked_rev(fs,
@@ -2201,35 +2195,9 @@ pack_shard(const char *revs_dir,
                           scratch_pool));
   ffd->min_unpacked_rev = (svn_revnum_t)((shard + 1) * max_files_per_dir);
 
-  /* Finally, remove the existing shard directories.
-   * For revprops, clean up older obsolete shards as well as they might
-   * have been left over from an interrupted FS upgrade. */
+  /* Finally, remove the existing shard directories. */
   SVN_ERR(svn_io_remove_dir2(rev_shard_path, TRUE,
                              cancel_func, cancel_baton, scratch_pool));
-  if (revsprops_dir)
-    {
-      svn_node_kind_t kind = svn_node_dir;
-      apr_int64_t to_cleanup = shard;
-      do
-        {
-          SVN_ERR(svn_fs_x__delete_revprops_shard(revprops_shard_path,
-                                                  to_cleanup,
-                                                  max_files_per_dir,
-                                                  cancel_func, cancel_baton,
-                                                  scratch_pool));
-
-          /* If the previous shard exists, clean it up as well.
-             Don't try to clean up shard 0 as it we can't tell quickly
-             whether it actually needs cleaning up. */
-          revprops_shard_path = svn_dirent_join(revsprops_dir,
-                                                apr_psprintf(scratch_pool,
-                                                          "%" APR_INT64_T_FMT,
-                                                          --to_cleanup),
-                                                scratch_pool);
-          SVN_ERR(svn_io_check_path(revprops_shard_path, &kind, scratch_pool));
-        }
-      while (kind == svn_node_dir && to_cleanup > 0);
-    }
 
   /* Notify caller we're starting to pack this shard. */
   if (notify_func)
@@ -2273,8 +2241,7 @@ pack_body(void *baton,
   apr_int64_t i;
   svn_revnum_t youngest;
   apr_pool_t *iterpool;
-  const char *rev_data_path;
-  const char *revprops_data_path = NULL;
+  const char *data_path;
 
   /* If we aren't using sharding, we can't do any packing, so quit. */
   SVN_ERR(svn_fs_x__read_min_unpacked_rev(&ffd->min_unpacked_rev, pb->fs,
@@ -2287,9 +2254,7 @@ pack_body(void *baton,
   if (ffd->min_unpacked_rev == (completed_shards * ffd->max_files_per_dir))
     return SVN_NO_ERROR;
 
-  rev_data_path = svn_dirent_join(pb->fs->path, PATH_REVS_DIR, scratch_pool);
-  revprops_data_path = svn_dirent_join(pb->fs->path, PATH_REVPROPS_DIR,
-                                        scratch_pool);
+  data_path = svn_dirent_join(pb->fs->path, PATH_REVS_DIR, scratch_pool);
 
   iterpool = svn_pool_create(scratch_pool);
   for (i = ffd->min_unpacked_rev / ffd->max_files_per_dir;
@@ -2301,7 +2266,7 @@ pack_body(void *baton,
       if (pb->cancel_func)
         SVN_ERR(pb->cancel_func(pb->cancel_baton));
 
-      SVN_ERR(pack_shard(rev_data_path, revprops_data_path,
+      SVN_ERR(pack_shard(data_path,
                          pb->fs, i, ffd->max_files_per_dir,
                          ffd->revprop_pack_size,
                          ffd->compress_packed_revprops

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c?rev=1671407&r1=1671406&r2=1671407&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c Sun Apr  5 17:43:12 2015
@@ -1752,12 +1752,7 @@ svn_fs_x__pack_revprops_shard(svn_fs_t *
   manifest_file_path = svn_dirent_join(pack_file_dir, PATH_MANIFEST,
                                        scratch_pool);
 
-  /* Remove any existing pack file for this shard, since it is incomplete. */
-  SVN_ERR(svn_io_remove_dir2(pack_file_dir, TRUE, cancel_func, cancel_baton,
-                             scratch_pool));
-
-  /* Create the new directory and manifest file stream. */
-  SVN_ERR(svn_io_dir_make(pack_file_dir, APR_OS_DEFAULT, scratch_pool));
+  /* Create the manifest file stream. */
   SVN_ERR(svn_stream_open_writable(&manifest_stream, manifest_file_path,
                                    scratch_pool, scratch_pool));
 
@@ -1841,18 +1836,4 @@ svn_fs_x__pack_revprops_shard(svn_fs_t *
 
   return SVN_NO_ERROR;
 }
-
-svn_error_t *
-svn_fs_x__delete_revprops_shard(const char *shard_path,
-                                apr_int64_t shard,
-                                int max_files_per_dir,
-                                svn_cancel_func_t cancel_func,
-                                void *cancel_baton,
-                                apr_pool_t *scratch_pool)
-{
-  SVN_ERR(svn_io_remove_dir2(shard_path, TRUE,
-                             cancel_func, cancel_baton, scratch_pool));
-
-  return SVN_NO_ERROR;
-}
 

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.h?rev=1671407&r1=1671406&r2=1671407&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.h (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.h Sun Apr  5 17:43:12 2015
@@ -99,21 +99,6 @@ svn_fs_x__pack_revprops_shard(svn_fs_t *
                               void *cancel_baton,
                               apr_pool_t *scratch_pool);
 
-/* Delete the non-packed revprop SHARD at SHARD_PATH with exactly
- * MAX_FILES_PER_DIR revprop files in it.  If this is shard 0, keep the
- * revprop file for revision 0.
- *
- * CANCEL_FUNC and CANCEL_BATON are used in the usual way.  Temporary
- * allocations are done in SCRATCH_POOL.
- */
-svn_error_t *
-svn_fs_x__delete_revprops_shard(const char *shard_path,
-                                apr_int64_t shard,
-                                int max_files_per_dir,
-                                svn_cancel_func_t cancel_func,
-                                void *cancel_baton,
-                                apr_pool_t *scratch_pool);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/transaction.c?rev=1671407&r1=1671406&r2=1671407&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/transaction.c Sun Apr  5 17:43:12 2015
@@ -3429,7 +3429,7 @@ commit_body(void *baton,
             return svn_error_trace(err);
           svn_error_clear(err);
           SVN_ERR(svn_io_copy_perms(svn_dirent_join(cb->fs->path,
-                                                    PATH_REVPROPS_DIR,
+                                                    PATH_REVS_DIR,
                                                     subpool),
                                     new_dir, subpool));
         }

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/util.c?rev=1671407&r1=1671406&r2=1671407&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/util.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/util.c Sun Apr  5 17:43:12 2015
@@ -163,7 +163,7 @@ construct_shard_sub_path(svn_fs_t *fs,
   char buffer[SVN_INT64_BUFFER_SIZE + sizeof(PATH_EXT_PACKED_SHARD)] = { 0 };
 
   /* Select the appropriate parent path constant. */
-  const char *parent = revprops ? PATH_REVPROPS_DIR : PATH_REVS_DIR;
+  const char *parent = PATH_REVS_DIR;
 
   /* String containing the shard number. */
   apr_size_t len = svn__i64toa(buffer, rev / ffd->max_files_per_dir);

Modified: subversion/branches/fsx-1.10/subversion/tests/libsvn_fs_x/fs-x-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/libsvn_fs_x/fs-x-pack-test.c?rev=1671407&r1=1671406&r2=1671407&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/tests/libsvn_fs_x/fs-x-pack-test.c (original)
+++ subversion/branches/fsx-1.10/subversion/tests/libsvn_fs_x/fs-x-pack-test.c Sun Apr  5 17:43:12 2015
@@ -657,7 +657,7 @@ recover_fully_packed(const svn_test_opts
   /* Now, delete the youngest revprop file, and recover again.  This
      time we want to see an error! */
   SVN_ERR(svn_io_remove_file2(
-              svn_dirent_join_many(pool, REPO_NAME, PATH_REVPROPS_DIR,
+              svn_dirent_join_many(pool, REPO_NAME, PATH_REVS_DIR,
                                    apr_psprintf(pool, "%ld/p%ld",
                                                 after_rev / SHARD_SIZE,
                                                 after_rev),