Dan Smith created GEODE-229:
-------------------------------

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

Reply via email to