/[Apache-SVN]
ViewVC logotype

Revision 1604421


Jump to revision: Previous Next
Author: stefan2
Date: Sat Jun 21 15:15:30 2014 UTC (10 years, 6 months ago)
Changed paths: 18
Log Message:
Append index data to the rev data file instead of using separate files.

This gives unpacked FSFS format 7 similar I/O characteristics and disk
space usage as earlier formats.  It also eliminates the need for retries
after a potential background pack run because each file is now always
consistent with itself (earlier, data or index files might already have
been deleted while the respective other was still valid).  Overall,
most of this patch is removing code necessary to handle separate files.

The new file format is simple:

  <rep data><l2p index><p2l index><footer><footer length>

with the first three being identical what we had before. <footer length>
is a single byte giving the length of the preceding footer, so it's
easier to extract than the pre-f7 rev trailer and there is only one
per pack / rev file.

The footer itself is just two decimal file offsets marking the start
of the index sections, separated by a single space char.

* subversion/libsvn_fs_fs/low_level.h
  (svn_fs_fs__parse_footer,
   svn_fs_fs__unparse_footer): Declare new parser / generator API for the
                               f7 footer, similar to f6- revision trailer
                               but slightly simplified.

* subversion/libsvn_fs_fs/low_level.c
  (svn_fs_fs__parse_footer,
   svn_fs_fs__unparse_footer): Implement.

* subversion/libsvn_fs_fs/rev_file.h
  (svn_fs_fs__revision_file_t): Add members for footer contents access
                                block size.
  (svn_fs_fs__reopen_revision_file): Drop. Retry is no longer necessary.
  (svn_fs_fs__auto_read_footer): Declare new function that reads the footer
                                 if we didn't yet.

* subversion/libsvn_fs_fs/rev_file.c
  (svn_fs_fs__reopen_revision_file): Drop.
  (svn_fs_fs__auto_read_footer): Implement.
  (svn_fs_fs__close_revision_file): Index streams don't carry any releasable
                                    resources anymore.

* subversion/libsvn_fs_fs/index.h
  (svn_fs_fs__packed_stream_close): Drop.  There are no independent file
                                    resources linked to the index data
                                    streams anymore.
  (svn_fs_fs__l2p_index_create,
   svn_fs_fs__p2l_index_create): Rename to ...
  (svn_fs_fs__l2p_index_append
   svn_fs_fs__p2l_index_create): ... these and accept an open file instead
                                 of a file name to be created.

* subversion/libsvn_fs_fs/index.c
  (packed_stream_open): Instead of opening our own index file, accept an
                        already open one and use the specified offset range.
  (svn_fs_fs__packed_stream_close): Drop.
  (index_create): Drop.  The files already exist.
  (svn_fs_fs__l2p_index_create,
   svn_fs_fs__p2l_index_create): Rename to ...
  (svn_fs_fs__l2p_index_append
   svn_fs_fs__p2l_index_create): ... these and use the already open file
                                 instead of creating new ones.
  (retry_open_l2p_index,
   retry_open_p2l_index): No longer necessary.
  (svn_fs_fs__item_offset,
   svn_fs_fs__p2l_get_max_offset): No lookup retry necessary anymore.
  (auto_open_l2p_index,
   auto_open_p2l_index): Make sure we know the index location and then
                         open the stream based on the existing file.

* subversion/libsvn_fs_fs/transaction.h
  (svn_fs_fs__add_index_data): New private API that combines index data
                               with the rep data file and finalizes it.

* subversion/libsvn_fs_fs/transaction.c
  (svn_fs_fs__add_index_data): Implement.
  (commit_body): Use the above.

* subversion/libsvn_fs_fs/fs_fs.c
  (write_revision_zero): Update r0 template by simply appending the
                         index contents and a final footer.

* subversion/libsvn_fs_fs/cached_data.c
  (block_read): Remove the now unnecessary retry-on-pack code.

* subversion/libsvn_fs_fs/hotcopy.c
  (hotcopy_copy_shard_file): Remove index file copy code.
  (hotcopy_copy_packed_shard,
   hotcopy_revisions): Update callers.

* subversion/libsvn_fs_fs/pack.c
  (close_pack_context): Use the new transaction.h API to finalize the
                        index data.
  (pack_range): Instead of ending with the file, revision content now ends
                where L2P index data starts.

* subversion/libsvn_fs_fs/util.h
  (svn_fs_fs__path_l2p_index,
   svn_fs_fs__path_p2l_index): Drop. These are no longer separate files.

* subversion/libsvn_fs_fs/util.c
  (svn_fs_fs__path_l2p_index,
   svn_fs_fs__path_p2l_index): Drop.

* subversion/libsvn_fs_fs/verify.c
  (compare_p2l_to_rev): Rev contents now ends where the L2P index begins.

* subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
  (pack_filesystem): There are no separate index files anymore.

* subversion/tests/cmdline/svnadmin_tests.py
  (read_l2p): Use contents of the rev file instead of a separate index file.
  (set_changed_path_list): Parse footer and splice data correctly retaining
                           the index contents as-is.

* tools/server-side/svnfsfs/load-index-cmd.c
  (write_p2l_index, 
   write_l2p_index): Instead of creating the final index files, create
                     the proto-index files only.
  (load_index): Trim the old index from the pack / rev file and append
                the new ones using our new transaction.h API.


Changed paths

Path Details
Directorysubversion/trunk/subversion/libsvn_fs_fs/cached_data.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/fs_fs.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/hotcopy.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/index.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/index.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/low_level.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/low_level.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/pack.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/rev_file.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/rev_file.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/transaction.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/transaction.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/util.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/util.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_fs_fs/verify.c modified , text changed
Directorysubversion/trunk/subversion/tests/cmdline/svnadmin_tests.py modified , text changed
Directorysubversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c modified , text changed
Directorysubversion/trunk/tools/server-side/svnfsfs/load-index-cmd.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26