Skip to content

Commit 0e170e6

Browse files
committed
wip: TODO notes
1 parent 5c43077 commit 0e170e6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/couch/src/couch_bt_engine.erl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,31 @@ finish_compaction(OldState, DbName, Options, {CompactFilePath, SrcGen}) ->
732732
[OldSeq, NewSeq]
733733
),
734734
ok = decref(NewState1),
735+
736+
% TODO: What should we do here when generation > 0? The gen-0 file
737+
% has gained new doc data, which the .compact file does not have,
738+
% so we cannot swap over to the compacted file without data loss.
739+
% However, if gen > 0, then further compaction will not move the
740+
% new bodies out of the gen-0 file. Does this command "resume" to
741+
% just cover the most recent writes, or does it re-scan the whole
742+
% file?
743+
%
744+
% all new data goes too foo.couch
745+
% when compacting, foo.couch structure -> foo.couch.compact
746+
%
747+
% data cases:
748+
%
749+
% gen=0
750+
% foo.couch -> foo.1.couch
751+
%
752+
% gen=N
753+
% foo.couch -> foo.couch.compact
754+
% foo.N.couch -> foo.N+1.couch
755+
%
756+
% gen=M
757+
% foo.couch -> foo.couch.compact
758+
% foo.M.couch -> foo.M.couch.compact.maxgen
759+
735760
start_compaction(OldState, DbName, SrcGen, Options, self())
736761
end.
737762

0 commit comments

Comments
 (0)