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 2013/10/14 22:36:10 UTC

svn commit: r1532078 - /subversion/branches/log-addressing/subversion/libsvn_fs_fs/cached_data.c

Author: stefan2
Date: Mon Oct 14 20:36:10 2013
New Revision: 1532078

URL: http://svn.apache.org/r1532078
Log:
On the log-addressing branch:  Finally, make the index access use the
same packing state as the rev / pack file.

This eliminates the need for local stream objects as the index file
streams are provided by the revision file struct.

The error handling in case of an intermittent pack operation is as
follows: L2P index will re-open the rev / pack file and then return
the information consistent with the new state.  Same for P2L index
functions that don't take an offset as input.  P2L index functions
taking an offset as input need to return an error in that case because
the offset is invalid now and the caller may decide how to initiate
a retry.

* subversion/libsvn_fs_fs/index.c
  (base_revision): drop as info is provided by rev_file
  (retry_open_l2p_index): new function
  (auto_open_l2p_index,
   get_l2p_header_body,
   get_l2p_page_info,
   get_l2p_page_table,
   get_l2p_page,
   prefetch_l2p_pages,
   l2p_index_lookup,
   get_l2p_header): use revision file struct instead of a stream;
                    also take pack info from that struct
  (svn_fs_fs__l2p_get_max_ids): use local revision file structs
                                instead of a stream
  (svn_fs_fs__item_offset): use revision file struct instead of a stream;
                            also take pack info from that struct;
                            retry once upon failure and changed pack status
  (retry_open_p2l_index,
   auto_open_p2l_index): new functions modelled after their L2P equivalent
  (svn_fs_fs__p2l_index_create,
   get_p2l_header,
   get_p2l_page_info,
   get_p2l_page,
   prefetch_p2l_page): use revision file struct instead of a stream;
                       also take pack info from that struct;
                       drop obsolete function parameters
  (get_p2l_keys,
   p2l_index_lookup,
   svn_fs_fs__p2l_index_lookup): use revision file struct instead of a stream;
                                 also take pack info from that struct
  (p2l_entry_lookup): merge into ...
  (svn_fs_fs__p2l_entry_lookup): ... this one;
                                 use revision file struct instead of a stream
  (p2l_get_max_offset): new function, core functionality taken from ...
  (svn_fs_fs__p2l_get_max_offset): ... this one; retry once upon failure and
                                   changed pack status

Modified:
    subversion/branches/log-addressing/subversion/libsvn_fs_fs/cached_data.c

Modified: subversion/branches/log-addressing/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-addressing/subversion/libsvn_fs_fs/cached_data.c?rev=1532078&r1=1532077&r2=1532078&view=diff
==============================================================================
--- subversion/branches/log-addressing/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/log-addressing/subversion/libsvn_fs_fs/cached_data.c Mon Oct 14 20:36:10 2013
@@ -2610,8 +2610,12 @@ block_read(void **result,
           revision_file->is_packed != svn_fs_fs__is_packed_rev(fs, revision))
         {
           if (result && !*result)
-            SVN_ERR(block_read(result, fs, revision, item_index,
-                                revision_file, result_pool, scratch_pool));
+            {
+              SVN_ERR(svn_fs_fs__reopen_revision_file(revision_file, fs, 
+                                                      revision));
+              SVN_ERR(block_read(result, fs, revision, item_index,
+                                  revision_file, result_pool, scratch_pool));
+            }
 
           return SVN_NO_ERROR;
         }