[GitHub] [hbase] sunhelly commented on a change in pull request #3831: HBASE-26249 Ameliorate compaction made by bul…

2021-11-22 Thread GitBox


sunhelly commented on a change in pull request #3831:
URL: https://github.com/apache/hbase/pull/3831#discussion_r754141891



##
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionRequester.java
##
@@ -44,6 +44,12 @@ void requestCompaction(HRegion region, String why, int 
priority,
   void requestCompaction(HRegion region, HStore store, String why, int 
priority,
   CompactionLifeCycleTracker tracker, @Nullable User user) throws 
IOException;
 
+  /**
+   * Request system compaction on the given store.
+   */
+  void requestSystemCompaction(HRegion region, HStore store, String why, 
boolean checkUnderCompact)

Review comment:
   Got it, thanks.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [hbase] sunhelly commented on a change in pull request #3831: HBASE-26249 Ameliorate compaction made by bul…

2021-11-21 Thread GitBox


sunhelly commented on a change in pull request #3831:
URL: https://github.com/apache/hbase/pull/3831#discussion_r753970108



##
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
##
@@ -7050,11 +7053,15 @@ String prepareBulkLoad(byte[] family, String srcPath, 
boolean copyFile)
   HStore store = getStore(family);
   try {
 if (this.rsServices != null && store.needsCompaction()) {
-  this.rsServices.getCompactionRequestor().requestCompaction(this, 
store,
-"bulkload hfiles request compaction", Store.PRIORITY_USER + 1,
-CompactionLifeCycleTracker.DUMMY, null);
-  LOG.debug("bulkload hfiles request compaction region : {}, 
family : {}",
-this.getRegionInfo(), family);
+  if 
(!this.rsServices.getCompactionRequestor().isUnderCompaction(store)) {

Review comment:
   Yes, needsCompaction still returns true if it has not run a compaction 
yet.
   The compaction of a store has several steps,
   1. if needCompact(), add a compaction runner of the store to the queue;
   2. select files to compact;
   3. do compact the selected files.
   If a store is added a compaction runner, but waiting in the queue, then next 
needCompact() is still true, and it will be add another compaction runner to 
queue. 
   
   The isUnderCompaction only means whether a store has added a compaction 
runner to the queue.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [hbase] sunhelly commented on a change in pull request #3831: HBASE-26249 Ameliorate compaction made by bul…

2021-11-21 Thread GitBox


sunhelly commented on a change in pull request #3831:
URL: https://github.com/apache/hbase/pull/3831#discussion_r753972653



##
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
##
@@ -299,4 +299,11 @@
* if you try to set a configuration.
*/
   Configuration getReadOnlyConfiguration();
+
+  /**
+   * @return the identifier string of a store, formatted to 
encodeRegionName:familyName
+   */
+  default String getIdentifier() {

Review comment:
   I used this name in the log printing, I think the store info is useful 
in the compaction logs...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [hbase] sunhelly commented on a change in pull request #3831: HBASE-26249 Ameliorate compaction made by bul…

2021-11-21 Thread GitBox


sunhelly commented on a change in pull request #3831:
URL: https://github.com/apache/hbase/pull/3831#discussion_r753970108



##
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
##
@@ -7050,11 +7053,15 @@ String prepareBulkLoad(byte[] family, String srcPath, 
boolean copyFile)
   HStore store = getStore(family);
   try {
 if (this.rsServices != null && store.needsCompaction()) {
-  this.rsServices.getCompactionRequestor().requestCompaction(this, 
store,
-"bulkload hfiles request compaction", Store.PRIORITY_USER + 1,
-CompactionLifeCycleTracker.DUMMY, null);
-  LOG.debug("bulkload hfiles request compaction region : {}, 
family : {}",
-this.getRegionInfo(), family);
+  if 
(!this.rsServices.getCompactionRequestor().isUnderCompaction(store)) {

Review comment:
   Yes, the compaction of a store has several steps,
   1. if needCompact(), add a compaction runner of the store to the queue;
   2. select files to compact;
   3. do compact the selected files.
   If a store is added a compaction runner, but waiting in the queue, then next 
needCompact() is still true, and it will be add another compaction runner to 
queue. 
   The isUnderCompaction only means whether a store has added a compaction 
runner to the queue.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org