You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Zhou wenjian (JIRA)" <ji...@apache.org> on 2012/11/08 10:28:13 UTC

[jira] [Commented] (HBASE-6563) s.isMajorCompaction() throws npe will cause current major Compaction checking abort

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

Zhou wenjian commented on HBASE-6563:
-------------------------------------

[~lhofhansl]
not quite follow you, the npe will be throwed in trunk too, i think.

 private boolean isMajorCompaction(final List<StoreFile> filesToCompact) throws IOException {
    boolean result = false;
    long mcTime = getNextMajorCompactTime();
    if (filesToCompact == null || filesToCompact.isEmpty() || mcTime == 0) {
      return result;
    } long lowTimestamp = getLowestTimestamp(filesToCompact);
    long now = System.currentTimeMillis();
    if (lowTimestamp > 0l && lowTimestamp < (now - mcTime)) {
      // Major compaction time has elapsed.
      if (filesToCompact.size() == 1) {
        // Single file
        StoreFile sf = filesToCompact.get(0);
        long oldest =
            (sf.getReader().timeRangeTracker == null) ?
                Long.MIN_VALUE :
                now - sf.getReader().timeRangeTracker.minimumTimestamp;

if the file to compact is closed after the check, npe will be throwed too, which is  same to 94 and 90.
the  bad side is that current major compaction check for region is interrupted
IMO, need to catch and just Ingore it.
                
> s.isMajorCompaction() throws npe will cause current major Compaction checking abort
> -----------------------------------------------------------------------------------
>
>                 Key: HBASE-6563
>                 URL: https://issues.apache.org/jira/browse/HBASE-6563
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>            Reporter: Zhou wenjian
>            Assignee: Zhou wenjian
>         Attachments: HBASE-6563-trunk.patch, HBASE-6563-trunk-v2.patch, HBASE-6563-trunk-v3.patch
>
>
> 2012-05-05 00:49:43,265 ERROR org.apache.hadoop.hbase.regionserver.HRegionServer$MajorCompactionChecker: Caught exception
> java.lang.NullPointerException
> at org.apache.hadoop.hbase.regionserver.Store.isMajorCompaction(Store.java:938)
> at org.apache.hadoop.hbase.regionserver.Store.isMajorCompaction(Store.java:917)
> at org.apache.hadoop.hbase.regionserver.HRegion.isMajorCompaction(HRegion.java:3250)
> at org.apache.hadoop.hbase.regionserver.HRegionServer$MajorCompactionChecker.chore(HRegionServer.java:1222)
> at org.apache.hadoop.hbase.Chore.run(Chore.java:66)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira