Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Ejson Body Instead of Compressed Body for External size #606

Merged
merged 9 commits into from
Jul 15, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup and formatting
  • Loading branch information
Tony Sun committed Jul 12, 2017
commit b3eb718098f1b5e64c823e9b6d515764ca7841e5
7 changes: 4 additions & 3 deletions src/couch/src/couch_db.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1112,9 +1112,10 @@ prepare_doc_summaries(Db, BucketList) ->
end,
SummaryChunk = couch_db_updater:make_doc_summary(Db, {Body, DiskAtts}),
Meta = Doc#doc.meta,
ExternalSize = ?term_size(Body),
Doc#doc{body = {summary, SummaryChunk, SizeInfo, AttsFd},
meta = [{ejson_size, ExternalSize} | Meta]}
Doc#doc{
body = {summary, SummaryChunk, SizeInfo, AttsFd},
meta = [{ejson_size, ?term_size(Body)} | Meta]
}
end,
Bucket) || Bucket <- BucketList].

Expand Down
1 change: 0 additions & 1 deletion src/couch/src/couch_db_updater.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,6 @@ check_md5(_, _) -> throw(md5_mismatch).

copy_docs(Db, #db{fd = DestFd} = NewDb, MixedInfos, Retry) ->
DocInfoIds = [Id || #doc_info{id=Id} <- MixedInfos],
Compress = NewDb#db.compression,
LookupResults = couch_btree:lookup(Db#db.id_tree, DocInfoIds),
% COUCHDB-968, make sure we prune duplicates during compaction
NewInfos0 = lists:usort(fun(#full_doc_info{id=A}, #full_doc_info{id=B}) ->
Expand Down