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

yuqi updated HBASE-25020:
-------------------------
    Description: 
In `RatioBasedCompactionPolicy#shouldPerformMajorCompaction`



{code:java}
// mcTime can be less than 0
long mcTime = getNextMajorCompactTime(filesToCompact);

//this check logic can't handle the condtion that mcTime is less than 0
    if (filesToCompact == null || filesToCompact.isEmpty() || mcTime == 0) {
      return result;
    }
  ....

  // As long as lowTimestamp > 0, the following logic is true, and major 
compaction will run continually
  if (lowTimestamp > 0L && lowTimestamp < (now - mcTime))

{code}


Am i wrong?, By the way, do hbase allow to set negative values to properties 
like this? is it necessary to make valid check?


  was:
In `RatioBasedCompactionPolicy#shouldPerformMajorCompaction`



{code:java}
// mcTime can be less than 0
long mcTime = getNextMajorCompactTime(filesToCompact);

//this check logic can't handle the condtion that mcTime is less than 0
    if (filesToCompact == null || filesToCompact.isEmpty() || mcTime == 0) {
      return result;
    }
  ....

  // As long as lowTimestamp > 0, the following logic is true, and major 
compaction will run continually
  if (lowTimestamp > 0L && lowTimestamp < (now - mcTime))

{code}



> Fix major compaction interval check logic bug when value of 
> `hbase.hregion.majorcompaction` is below 0
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-25020
>                 URL: https://issues.apache.org/jira/browse/HBASE-25020
>             Project: HBase
>          Issue Type: Bug
>            Reporter: yuqi
>            Assignee: yuqi
>            Priority: Minor
>
> In `RatioBasedCompactionPolicy#shouldPerformMajorCompaction`
> {code:java}
> // mcTime can be less than 0
> long mcTime = getNextMajorCompactTime(filesToCompact);
> //this check logic can't handle the condtion that mcTime is less than 0
>     if (filesToCompact == null || filesToCompact.isEmpty() || mcTime == 0) {
>       return result;
>     }
>   ....
>   // As long as lowTimestamp > 0, the following logic is true, and major 
> compaction will run continually
>   if (lowTimestamp > 0L && lowTimestamp < (now - mcTime))
> {code}
> Am i wrong?, By the way, do hbase allow to set negative values to properties 
> like this? is it necessary to make valid check?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to