You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/08/20 01:36:45 UTC

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

    [ https://issues.apache.org/jira/browse/GEODE-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14703962#comment-14703962 ] 

ASF subversion and git services commented on GEODE-229:
-------------------------------------------------------

Commit 936065f4194f5df97d83b26ca029e66bb69a8d15 in incubator-geode's branch refs/heads/develop from [~upthewaterspout]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;h=936065f ]

GEODE-229: Fixed javadoc for DiskStoreFactory.setCompactionThreshold

The javadocs and the behavior of the code were backwards. The code
compacts when the live data gets below the threshold. I changed the
javadocs to avoid screwing up someone who was relied on the old
behavior.

Adding a unit test of this property.


> 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
>
> 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)