-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-28654 Support only remove expired files in the compact process #6008
base: master
Are you sure you want to change the base?
Conversation
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
I prefer we change the config name to something like 'compaction.skip-merging-compact', to indicate that this config is used to skip the real compaction operation. As even if we set this config to true, there are still other options which could make us not remove expired files, such as 'hbase.store.delete.expired.storefile'. We should carefully document these behaviors. |
You can also send a discuss email to dev list, to see if there are better names for this config, since I'm not a native English speaker... |
cd969e0
to
a9f756b
Compare
OK. I have changed and add logs for the config 'hbase.store.delete.expired.storefile' is false. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
* true. If flag is false then do normal compactions. | ||
* @return true if table compaction only remove expired file, skipping merge files. | ||
*/ | ||
boolean isSkipMergingCompaction(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldSkipMergingCompaction
make more sense to me over isSkipMergingCompaction
@@ -1453,6 +1453,15 @@ public Optional<CompactionContext> requestCompaction(int priority, | |||
// Before we do compaction, try to get rid of unneeded files to simplify things. | |||
removeUnneededFiles(); | |||
|
|||
if (this.region.getTableDescriptor().isSkipMergingCompaction()) { | |||
if (!conf.getBoolean("hbase.store.delete.expired.storefile", true)) { | |||
LOG.info("Because the conf of hbase.store.delete.expired.storefile is false, so the table " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rephrase as "Since config 'hbase.store.delete.expired.storefile' is set to false, ignoring SKIP_MERGING_COMPACTION set at table level"
@@ -85,6 +85,15 @@ public class TableDescriptorBuilder { | |||
public static final String COMPACTION_ENABLED = "COMPACTION_ENABLED"; | |||
private static final Bytes COMPACTION_ENABLED_KEY = new Bytes(Bytes.toBytes(COMPACTION_ENABLED)); | |||
|
|||
/** | |||
* Used by HBase Shell interface to access this metadata attribute which denotes if the table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we planning to expose this via shell as another commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, we can use shell to change the table description with SKIP_MERGING_COMPACTION.
alter 'tableName',CONFIGURATION => {'SKIP_MERGING_COMPACTION' => 'true'}
@@ -1453,6 +1453,15 @@ public Optional<CompactionContext> requestCompaction(int priority, | |||
// Before we do compaction, try to get rid of unneeded files to simplify things. | |||
removeUnneededFiles(); | |||
|
|||
if (this.region.getTableDescriptor().isSkipMergingCompaction()) { | |||
if (!conf.getBoolean("hbase.store.delete.expired.storefile", true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also could you refactor 'hbase.store.delete.expired.storefile' into a variable along with its default value? I see only one usage of this in the code base, apart from testcode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also could you refactor 'hbase.store.delete.expired.storefile' into a variable along with its default value? I see only one usage of this in the code base, apart from testcode.
I have changed based on your suggestion. Please review again when you have time.
a9f756b
to
80c7b26
Compare
80c7b26
to
4665a54
Compare
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
https://issues.apache.org/jira/browse/HBASE-28654