You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "zhoushuaifeng (JIRA)" <ji...@apache.org> on 2011/06/09 09:21:59 UTC

[jira] [Created] (HBASE-3969) Outdated data can not be cleaned in time

Outdated data can not be cleaned in time
----------------------------------------

                 Key: HBASE-3969
                 URL: https://issues.apache.org/jira/browse/HBASE-3969
             Project: HBase
          Issue Type: Improvement
          Components: regionserver
    Affects Versions: 0.90.3, 0.90.2, 0.90.1
            Reporter: zhoushuaifeng
             Fix For: 0.90.4


Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050781#comment-13050781 ] 

Ted Yu commented on HBASE-3969:
-------------------------------

Compaction code has been rewritten in TRUNK.

For 0.90, PriorityCompactionQueue.addToRegionsInQueue() wouldn't touch a request which was already in regionsInQueue.
If we record the time when CompactionRequest for a major compaction was put in regionsInQueue, the above check can be modified to boost the priority of the request after specified amount of time has elapsed.
Changes in add() method is also required.

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050237#comment-13050237 ] 

zhoushuaifeng commented on HBASE-3969:
--------------------------------------

I have done a test on hbase use ycsb. 3 region servers and 30,000 insert per second. With no patch solution1, we can see from ganglia that after 3 days, about 50 regions stay in the compact queue, and out dated data can not be cleaned intime. And after added patch solution1, out dated data can be cleaned in time.
Logs show that how the patch works:(our setings: blockingStoreFiles is 10, compactionThreshold is 3, so the priority is 6.)
2011-06-16 13:06:31,667 DEBUG org.apache.hadoop.hbase.regionserver.CompactSplitThread: Compaction requested for ufdr1,0201586139100003#4523000,1308096774090.080ad1468ece2c12efeb2480be632871. because regionserver60020.majorCompactionChecker requests major compaction; priority=6, compaction queue size=25
2011-06-16 13:06:31,670 DEBUG org.apache.hadoop.hbase.regionserver.CompactSplitThread: Compaction requested for ufdr2,00380,1308118259184.75a7c5da1c2ffadd043f7f6eea2b22b5. because regionserver60020.majorCompactionChecker requests major compaction; priority=6, compaction queue size=26
2011-06-16 13:06:31,675 DEBUG org.apache.hadoop.hbase.regionserver.CompactSplitThread: Compaction requested for ufdr1,0198486139199963#0404000,1308093001292.50c82e3de192aa621d3d68465f3f9530. because regionserver60020.majorCompactionChecker requests major compaction; priority=6, compaction queue size=27


> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

zhoushuaifeng updated HBASE-3969:
---------------------------------

    Attachment: HBASE-3969-solution1-for-trunk-v4.patch
                HBASE-3969-solution1-for-branch-v4.patch

I have made the change and attached the patch, please review it.

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch-v2.patch, HBASE-3969-solution1-for-branch-v3.patch, HBASE-3969-solution1-for-branch-v4.patch, HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1-for-trunk-v2.patch, HBASE-3969-solution1-for-trunk-v3.patch, HBASE-3969-solution1-for-trunk-v4.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050594#comment-13050594 ] 

stack commented on HBASE-3969:
------------------------------

@ zhoushuaifeng I take it you are doing lots of deletes or you are doing lots of aging out of old versions?  Do you think the ycsb represents what your actual loading will be like?

You have identified an issue with our scheme where-by we assign a priority on initial queuing and while the priority may have been correct at the time, circumstances change over time.  Its as though the priority should change with as the situation evolves?  If something has been queued a long time, its priority should go up?  Perhaps go up only if a major compaction?   This would require us adding something to peek at queues on a period.

The solution of (between 1 and blockingStoreFiles - compactionThreshold) seems unsatisfactory, don't you agree.  Its hard to tell how it will play out over time on a cluster?

Looking at your patch, you might want to do a check for hbase.hstore.blockingStoreFiles > hbase.hstore.compactionThreshold

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050857#comment-13050857 ] 

zhoushuaifeng commented on HBASE-3969:
--------------------------------------

I agree Changes in add() method is required. Because when flush a file, it will triger a compact, and it should renew the priority of the region if it's file count increase.
And this:
{code}
  public int getCompactPriority() {
    int count = Integer.MAX_VALUE;
    for(Store store : stores.values()) {
      count = Math.min(count, store.getCompactPriority());
    }
    return count;
  }
{code}
I think may be Math.max may be better. In case some store have too much files and blocked.
To boost the priority of the request after specified amount of time has elapsed is a good solution, but I'm afraid it will impact the regions needs compaction more as described in my comments 16/Jun/11 07:14

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

zhoushuaifeng updated HBASE-3969:
---------------------------------

    Attachment: HBASE-3969-solution1.patch

There may be several solution to this problem:
1, Setting a proper and configure able priority to regions need major compact when sending them to the compact queue; (attached patch solution1)
2,  Setting the priority of regions need compact according how long it's keyvalues outdated.
3, Run a thread to check the compact queue, if some regions hanging in the quene for a long time, increase it's priority level.

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050250#comment-13050250 ] 

zhoushuaifeng commented on HBASE-3969:
--------------------------------------

Hi St, the 3rd solution may be not so good. For the regions in the queue, regions have files number close to or more than blockingStoreFiles should have the most higher priority, because if not, flush will be blocked and impact put. The secondary important is regions that need major compact to clean outdated data, reason has mentioned in this issue. But regions with few files(for example, only reach the compactionThreshold), and should do a minor compact should have the lowest priority, it does no matter how these regions hanging in the queue. 
So, I think may be setting the major compact priority to a proper value(between 1 and blockingStoreFiles - compactionThreshold) may be a better choice. How do you think?

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050850#comment-13050850 ] 

zhoushuaifeng commented on HBASE-3969:
--------------------------------------

Hi st, I don't do any deletes, I only set the TTL of the table to a few days.  When data's timestamps are old than the TTL, these data should be cleaned by a major compact. But if the region have no new data inserted for a while, there would be only 1 or 2 files in it, so the priority is very low. If there is large  through output, major compact will be delayed.
About the ycsb, we have done some change on it, it can load data as we want(the key, value, speed is all customized). THe scan is randomly, so it have a chance on the regions lots of data outdated but haven't cleaned intime.
I think there is no need to check for hbase.hstore.blockingStoreFiles > hbase.hstore.compactionThreshold, because the priority can be negative. When there are more files in the store than blockingStoreFiles, the flush operation will triger a compact, and the priority will be negative, we have seen that before. The negitive priority means that there are too many files in the store, and the flushing of this store may be blocked for at most 90 seconds. We have seen this in the logs before.
And also, the user mustn't set hbase.hstore.blockingStoreFiles <= hbase.hstore.compactionThreshold, if so, blocking will aways happen.



> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13046679#comment-13046679 ] 

stack commented on HBASE-3969:
------------------------------

Not that I know of.  Can you add one?

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

zhoushuaifeng updated HBASE-3969:
---------------------------------

    Attachment: HBASE-3969-solution1-for-branch.patch

because the trunk and branch has done much change on major compact checker, this is for the branch.

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

zhoushuaifeng updated HBASE-3969:
---------------------------------

    Attachment: HBASE-3969-solution1-for-trunk-v2.patch
                HBASE-3969-solution1-for-branch-v2.patch

{quote}
can you make major compaction a configuration with the default being what it is currently?  So the default behavior is not changed?  If so, that would be easy to commit.
{quote}
Good suggestion, thaks st. I made the change and attached the patch.

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch-v2.patch, HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1-for-trunk-v2.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056861#comment-13056861 ] 

Hudson commented on HBASE-3969:
-------------------------------

Integrated in HBase-TRUNK #1995 (See [https://builds.apache.org/job/HBase-TRUNK/1995/])
    

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>            Assignee: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch-v2.patch, HBASE-3969-solution1-for-branch-v3.patch, HBASE-3969-solution1-for-branch-v4.patch, HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1-for-trunk-v2.patch, HBASE-3969-solution1-for-trunk-v3.patch, HBASE-3969-solution1-for-trunk-v4.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050870#comment-13050870 ] 

zhoushuaifeng commented on HBASE-3969:
--------------------------------------

Sorry, I confused for a while about higher and lower priority, count = Math.min(count, store.getCompactPriority()); is ok. 

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050879#comment-13050879 ] 

zhoushuaifeng commented on HBASE-3969:
--------------------------------------

What will happen if we seting major priority between 1 and blockingStoreFiles - compactionThreshold may be like this: for example, blockingStoreFiles = 7, compactionThreshold = 3, we set major compact priority to 2:
If some region have 3 or 4 files, it's priority is lower than the major compact, the major compact will do first. But if the files in this region increase to 6 or 7, it's priority will be 1 or 0, the compact on this region will do first. So, the major compact will have a little higher priority but will not causing other regions blocked. Is it satisfactory?

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack resolved HBASE-3969.
--------------------------

      Resolution: Fixed
        Assignee: zhoushuaifeng
    Hadoop Flags: [Reviewed]

Thank you for providing the v4s of the patch Zhou.  Committed branch and trunk.

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>            Assignee: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch-v2.patch, HBASE-3969-solution1-for-branch-v3.patch, HBASE-3969-solution1-for-branch-v4.patch, HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1-for-trunk-v2.patch, HBASE-3969-solution1-for-trunk-v3.patch, HBASE-3969-solution1-for-trunk-v4.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050889#comment-13050889 ] 

stack commented on HBASE-3969:
------------------------------

bq. I think there is no need to check for hbase.hstore.blockingStoreFiles > hbase.hstore.compactionThreshold, because the priority can be negative

Ok.  Makes sense.

On raising major compaction priority, can you make major compaction a configuration with the default being what it is currently?  So the default behavior is not changed?  If so, that would be easy to commit.

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

zhoushuaifeng updated HBASE-3969:
---------------------------------

    Attachment: HBASE-3969-solution1-for-trunk-v3.patch
                HBASE-3969-solution1-for-branch-v3.patch

Make more improvement, if configured majorCompactPriority > r.getCompactPriority(), also use default priority.

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch-v2.patch, HBASE-3969-solution1-for-branch-v3.patch, HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1-for-trunk-v2.patch, HBASE-3969-solution1-for-trunk-v3.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050745#comment-13050745 ] 

Ted Yu commented on HBASE-3969:
-------------------------------

Should we introduce expiration to requests in compaction queue ?


> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050754#comment-13050754 ] 

stack commented on HBASE-3969:
------------------------------

@Ted I don't think will make zhoushuaifeng happy; he wants the major compaction to run, not be discarded because it too old.  Or what you thinking?

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13046949#comment-13046949 ] 

zhoushuaifeng commented on HBASE-3969:
--------------------------------------

It's difficult to find this problem. We do a long and large amount data read/write test then find it. After all, I think major compact is a little more important(that's why it's 'major'), it's reasonable to have a little higher priority. 
And solution1 need the least change, others may be more complex.

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "mingjian (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13046573#comment-13046573 ] 

mingjian commented on HBASE-3969:
---------------------------------

This bug is very difficult to find. Is there any way to let regions modified their priorities in Runtime?

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053114#comment-13053114 ] 

zhoushuaifeng commented on HBASE-3969:
--------------------------------------

Yes St, it's what I mean. Thanks a lot.
But here I think need small change:
{code}
+            } else if (s.isMajorCompaction()) {
+              if (majorCompactPriority == DEFAULT_PRIORITY ) {
+                this.instance.compactSplitThread.requestCompaction(r, s,
{code}
change to like this is better, because if the region have more storefiles, it will get higher priority by default than the configured settings, and at this situation, it's better to use default priority:
{code}
+            } else if (s.isMajorCompaction()) {
+              if (majorCompactPriority == DEFAULT_PRIORITY || 
+        	        majorCompactPriority > r.getCompactPriority()) {
+                this.instance.compactSplitThread.requestCompaction(r, s,
{code}

And may be it's better to set DEFAULT_PRIORITY to max integer, because compact priority can be -1 when the store files number equal to blockingStoreFiles+1.
{code}
+    private final static int DEFAULT_PRIORITY = Integer.MAX_VALUE;
{code}


> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch-v2.patch, HBASE-3969-solution1-for-branch-v3.patch, HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1-for-trunk-v2.patch, HBASE-3969-solution1-for-trunk-v3.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053045#comment-13053045 ] 

stack commented on HBASE-3969:
------------------------------

You are using this.instance.conf.getInt("hbase.hstore.blockingStoreFiles", 7) to indicate that we should use the default priority?  If so, why not just use a -1 altogether?  The mention of "hbase.hstore.blockingStoreFiles" I think will confuse folks who come along and read this code later.

Something like this:

{code}
Index: org/apache/hadoop/hbase/regionserver/HRegionServer.java
===================================================================
--- org/apache/hadoop/hbase/regionserver/HRegionServer.java     (revision 1138255)
+++ org/apache/hadoop/hbase/regionserver/HRegionServer.java     (working copy)
@@ -1050,12 +1050,22 @@
    */
   private static class CompactionChecker extends Chore {
     private final HRegionServer instance;
+    private final int majorCompactPriority;
+    private final static int DEFAULT_PRIORITY = -1;
 
     CompactionChecker(final HRegionServer h, final int sleepTime,
         final Stoppable stopper) {
       super("CompactionChecker", sleepTime, h);
       this.instance = h;
       LOG.info("Runs every " + StringUtils.formatTime(sleepTime));
+      
+      /* MajorCompactPriority is configurable.
+       * If not set, it will get the value of hbase.hstore.blockingStoreFiles,
+       * and the compaction will use default priority.
+       */
+      this.majorCompactPriority = this.instance.conf.
+        getInt("hbase.regionserver.compactionChecker.majorCompactPriority",
+        DEFAULT_PRIORITY);      
     }
 
     @Override
@@ -1065,10 +1075,19 @@
           continue;
         for (Store s : r.getStores().values()) {
           try {
-            if (s.isMajorCompaction() || s.needsCompaction()) {
+            if (s.needsCompaction()) {
               // Queue a compaction. Will recognize if major is needed.
               this.instance.compactSplitThread.requestCompaction(r, s,
-                  getName() + " requests major compaction");
+                getName() + " requests compaction");
+            } else if (s.isMajorCompaction()) {
+              if (majorCompactPriority == DEFAULT_PRIORITY ) {
+                this.instance.compactSplitThread.requestCompaction(r, s,
+                    getName() + " requests major compaction; use default priority");
+              } else {
+               this.instance.compactSplitThread.requestCompaction(r, s,
+                  getName() + " requests major compaction; use configured priority",
+                  this.majorCompactPriority); 
+              }
             }
           } catch (IOException e) {
             LOG.warn("Failed major compaction check on " + r, e);
{code}

Does this give you what you want?  If so, I'll commit (I can make it work for branch too).

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1-for-branch-v2.patch, HBASE-3969-solution1-for-branch-v3.patch, HBASE-3969-solution1-for-branch.patch, HBASE-3969-solution1-for-trunk-v2.patch, HBASE-3969-solution1-for-trunk-v3.patch, HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3969) Outdated data can not be cleaned in time

Posted by "zhoushuaifeng (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049579#comment-13049579 ] 

zhoushuaifeng commented on HBASE-3969:
--------------------------------------

For the 3rd solution, the trunk has a lot of change on compact thread, it's a big change. It's a little easier to the branch 0.90.x

> Outdated data can not be cleaned in time
> ----------------------------------------
>
>                 Key: HBASE-3969
>                 URL: https://issues.apache.org/jira/browse/HBASE-3969
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.90.1, 0.90.2, 0.90.3
>            Reporter: zhoushuaifeng
>             Fix For: 0.90.4
>
>         Attachments: HBASE-3969-solution1.patch
>
>
> Compaction checker will send regions to the compact queue to do compact. But the priority of these regions is too low if these regions have only a few storefiles. When there is large through output, and the compact queue will aways have some regions with higher priority. This may causing the major compact be delayed for a long time(even a few days),  and outdated data cleaning will also be delayed.
> In our test case, we found some regions sent to the queue by major compact checker hunging in the queue for more than 2 days! Some scanners on these regions cannot get availably data for a long time and lease expired.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira