You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2011/04/23 16:05:06 UTC
svn commit: r1096151 - /couchdb/trunk/src/couchdb/couch_db_updater.erl
Author: fdmanana
Date: Sat Apr 23 14:05:05 2011
New Revision: 1096151
URL: http://svn.apache.org/viewvc?rev=1096151&view=rev
Log:
Ignore pre 1.2 non leaf rev values without size information
These are not necessary for the calculation of the data size and, in some
cases by ignoring them, it can lead to a non nil database data size value
without requiring a full compaction in advance.
--This line, and those below, will be ignoed--
M trunk/src/couchdb/couch_db_updater.erl
Modified:
couchdb/trunk/src/couchdb/couch_db_updater.erl
Modified: couchdb/trunk/src/couchdb/couch_db_updater.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db_updater.erl?rev=1096151&r1=1096150&r2=1096151&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db_updater.erl (original)
+++ couchdb/trunk/src/couchdb/couch_db_updater.erl Sat Apr 23 14:05:05 2011
@@ -329,9 +329,11 @@ btree_by_id_split(#full_doc_info{id=Id,
btree_by_id_join(Id, {HighSeq, Deleted, DiskTree}) ->
{Tree, LeafsSize} =
couch_key_tree:mapfold(
- fun(_RevId, {IsDeleted, BodyPointer, UpdateSeq}, _Type, _Acc) ->
+ fun(_RevId, {IsDeleted, BodyPointer, UpdateSeq}, leaf, _Acc) ->
% pre 1.2 format, will be upgraded on compaction
{{IsDeleted == 1, BodyPointer, UpdateSeq, nil}, nil};
+ (_RevId, {IsDeleted, BodyPointer, UpdateSeq}, branch, Acc) ->
+ {{IsDeleted == 1, BodyPointer, UpdateSeq, nil}, Acc};
(_RevId, {IsDeleted, BodyPointer, UpdateSeq, Size}, leaf, Acc) ->
Acc2 = sum_leaf_sizes(Acc, Size),
{{IsDeleted == 1, BodyPointer, UpdateSeq, Size}, Acc2};