[
https://issues.apache.org/jira/browse/BOOKKEEPER-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13210161#comment-13210161
]
Ivan Kelly commented on BOOKKEEPER-160:
---------------------------------------
{quote}
> How I had imagined this working is that you create a new entry log to
compact into. You copy the entries across and then rename the file to the name
of the old entry log.
it is not safe to do as what you described. since after compaction, the
position of entries has been changed and we should let this kind of change be
reflected in the index file, otherwise we would lost it. The safe way is to let
the compacted entries go thru again the addEntry flow to apply the position
change to index file.
{quote}
Ack, you're right. I don't like it though. It creates a very tight coupling
between Bookie and EntryLogger. EntryLogger already has a coupling to Bookie,
but it could be decoupled quite simply (it only uses it to receive some
members). Im not sure how to deal with this.
{quote}
what I am thinking is that we need to a setting to let user control whether to
enable compaction or not and when to do compaction. e.g, user can configuration
the threshold to the size to half of the capacity of a disk, the compaction is
enabled when the capacity reaches this threshold. since compaction is expensive
to move entries.{quote}
They can disable compaction by setting both watermarks to 0.0. I think it's
better to enable it by default, as it means the code gets run more often, so
any bugs in the code will fall out of it quicker.
> bookie server needs to do compaction over entry log files to reclaim disk
> space
> -------------------------------------------------------------------------------
>
> Key: BOOKKEEPER-160
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-160
> Project: Bookkeeper
> Issue Type: Improvement
> Components: bookkeeper-server
> Affects Versions: 4.0.0
> Reporter: Sijie Guo
> Assignee: Sijie Guo
> Fix For: 4.1.0
>
> Attachments: BK-160.patch
>
>
> bookie server aggregates entries into entry log file. suppose there is lots
> of ledgers, each ledger has little messages. so a entry log file would
> contains messages from lots of different ledgers. if there is only one ledger
> not be deleted, the entry log file would not be removed, whose occupied disk
> space could not be reclaimed.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira