You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Anthony Baker (JIRA)" <ji...@apache.org> on 2016/01/15 07:14:57 UTC

[jira] [Closed] (GEODE-229) Javadocs for DiskStoreFactory.setCompactionThreshold are incorrect

     [ https://issues.apache.org/jira/browse/GEODE-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anthony Baker closed GEODE-229.
-------------------------------

> Javadocs for DiskStoreFactory.setCompactionThreshold are incorrect
> ------------------------------------------------------------------
>
>                 Key: GEODE-229
>                 URL: https://issues.apache.org/jira/browse/GEODE-229
>             Project: Geode
>          Issue Type: Bug
>            Reporter: Dan Smith
>            Assignee: Dan Smith
>             Fix For: 1.0.0-incubating.M1
>
>
> The javadocs for compaction-threshold imply that we compact as soon as the amount of garbage is equal or greater than the threshold.
> From DiskStoreFactory?.setCompactionThreshold
> {noformat}
> When the amount of garbage in an oplog exceeds this percentage then when a compaction
>    * is done this garbage will be cleaned up freeing up disk space. Garbage is created by
>    * entry destroys, entry updates, and region destroys.
> {noformat}
> However, looking at the code, it looks like we actually trigger compaction when the amount of non-garbage data is equal or less than the threshold:
> Here Oplog.needsCompaction, it looks like its saying the oplog needs compaction if the live count is less than the threshold.
> {code}
> long rvHWMtmp = this.totalCount.get();
>     if (rvHWMtmp > 0) {
>       long tlc = this.totalLiveCount.get();
>       if (tlc < 0) {
>         tlc = 0;
>       }
>       double rv = tlc;
>       double rvHWM = rvHWMtmp;
>       if (((rv / rvHWM) * 100) <= parent.getCompactionThreshold()) {
>         return true;
>       }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)