[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r34957 - in trunk/subversion: libsvn_fs_fs tests/libsvn_fs_fs

From: David Glasser <glasser_at_davidglasser.net>
Date: Sat, 27 Dec 2008 18:01:05 -0800

Which file do you think I'm going to ask you to update? :)

--dave

On Dec 27, 2008 11:52 AM, "Hyrum K. Wright" <hyrum_at_hyrumwright.org> wrote:

Author: hwright
Date: Sat Dec 27 11:52:22 2008
New Revision: 34957

Log:
For FSFS packing, put each pack file and manifest in it's own directory.
 This
brings back one of the hidden benefits of sharding: being able to grow a
repository by putting different directories on different filesystems.

* subversion/tests/libsvn_fs_fs/fs-pack-test.c
 (pack_filesystem): Update test.

* subversion/libsvn_fs_fs/fs_fs.c
 (path_rev_packed): Update to the new path scheme.
 (pack_shard): Update file and directory paths to reflect the new directory
   scheme.

Modified:
  trunk/subversion/libsvn_fs_fs/fs_fs.c
  trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c

Modified: trunk/subversion/libsvn_fs_fs/fs_fs.c
URL:
http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_fs_fs/fs_fs.c?pathrev=34957&r1=34956&r2=34957
==============================================================================
--- trunk/subversion/libsvn_fs_fs/fs_fs.c Sat Dec 27 01:07:24 2008
   (r34956)
+++ trunk/subversion/libsvn_fs_fs/fs_fs.c Sat Dec 27 11:52:22 2008
   (r34957)
@@ -172,9 +172,9 @@ path_rev_packed(svn_fs_t *fs, svn_revnum

  assert(ffd->max_files_per_dir);
  return svn_path_join_many(pool, fs->path, PATH_REVS_DIR,
- apr_psprintf(pool, "%ld.%s",
- rev / ffd->max_files_per_dir,
kind),
- NULL);
+ apr_psprintf(pool, "%ld.pack",
+ rev / ffd->max_files_per_dir),
+ kind, NULL);
 }

 static const char *
@@ -6715,37 +6715,29 @@ pack_shard(const char *revs_dir,
 {
  const char *tmp_path, *final_path;
  const char *pack_file_path, *manifest_file_path, *shard_path;
+ const char *pack_file_dir;
  svn_stream_t *pack_stream, *manifest_stream;
  svn_revnum_t start_rev, end_rev, rev;
  svn_stream_t *tmp_stream;
- svn_error_t *err;
  apr_off_t next_offset;
  apr_pool_t *iterpool;

  /* Some useful paths. */
- pack_file_path = svn_path_join(revs_dir,
- apr_psprintf(pool, "%" APR_INT64_T_FMT
".pack",
- shard), pool);
- manifest_file_path = svn_path_join(revs_dir,
- apr_psprintf(pool, "%" APR_INT64_T_FMT
".manifest",
- shard), pool);
+ pack_file_dir = svn_path_join(revs_dir,
+ apr_psprintf(pool, "%" APR_INT64_T_FMT ".pack",
shard),
+ pool);
+ pack_file_path = svn_path_join(pack_file_dir, "pack", pool);
+ manifest_file_path = svn_path_join(pack_file_dir, "manifest", pool);
  shard_path = svn_path_join(revs_dir,
                             apr_psprintf(pool, "%" APR_INT64_T_FMT, shard),
                             pool);

  /* Remove any existing pack file for this shard, since it is incomplete.
*/
- err = svn_io_remove_file(pack_file_path, pool);
- if (err)
- {
- if (APR_STATUS_IS_ENOENT(err->apr_err))
- svn_error_clear(err);
- else
- return err;
- }
- else
- SVN_ERR(svn_io_remove_file(manifest_file_path, pool));
+ SVN_ERR(svn_io_remove_dir2(pack_file_dir, TRUE, cancel_func,
cancel_baton,
+ pool));

- /* Create the new pack and manifest files. */
+ /* Create the new directory and pack and manifest files. */
+ SVN_ERR(svn_io_dir_make(pack_file_dir, APR_OS_DEFAULT, pool));
  SVN_ERR(svn_stream_open_writable(&pack_stream, pack_file_path, pool,
                                    pool));
  SVN_ERR(svn_stream_open_writable(&manifest_stream, manifest_file_path,
@@ -6784,6 +6776,7 @@ pack_shard(const char *revs_dir,

  SVN_ERR(svn_stream_close(manifest_stream));
  SVN_ERR(svn_stream_close(pack_stream));
+ SVN_ERR(svn_fs_fs__dup_perms(pack_file_dir, shard_path, pool));

  /* Update the max-pack-rev file to reflect our newly packed shard. */
  final_path = svn_path_join(fs_path, PATH_MIN_UNPACKED_REV, iterpool);

Modified: trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c
URL:
http://svn.collab.net/viewvc/svn/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c?pathrev=34957&r1=34956&r2=34957
==============================================================================
--- trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c Sat Dec 27 01:07:24
2008 (r34956)
+++ trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c Sat Dec 27 11:52:22
2008 (r34957)
@@ -184,7 +184,7 @@ pack_filesystem(const char **msg,
  for (i = 0; i < (MAX_REV + 1) / SHARD_SIZE; i++)
    {
      path = svn_path_join_many(pool, REPO_NAME, "revs",
- apr_psprintf(pool, "%d.pack", i / SHARD_SIZE), NULL);
+ apr_psprintf(pool, "%d.pack", i / SHARD_SIZE), "pack", NULL);

      /* These files should exist. */
      SVN_ERR(svn_io_check_path(path, &kind, pool));
@@ -193,7 +193,7 @@ pack_filesystem(const char **msg,
                                 "Expected pack file '%s' not found", path);

      path = svn_path_join_many(pool, REPO_NAME, "revs",
- apr_psprintf(pool, "%d.manifest", i / SHARD_SIZE), NULL);
+ apr_psprintf(pool, "%d.pack", i / SHARD_SIZE), "manifest",
NULL);
      SVN_ERR(svn_io_check_path(path, &kind, pool));
      if (kind != svn_node_file)
        return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=993854

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=994106
Received on 2008-12-28 09:59:32 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.