-
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-25549 Provide a switch that allows avoiding reopening all regions when modifying a table to prevent RIT storms. #2924
Conversation
a30d220
to
e3cfd88
Compare
💔 -1 overall
This message was automatically generated. |
0f54edb
to
14ca0e9
Compare
💔 -1 overall
This message was automatically generated. |
14ca0e9
to
9ca71f6
Compare
🎊 +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. |
Why a new command rather than an optional lazy flag for the existing command? |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@busbey Actually, I followed up the way of command 'alter_async' do, which added a so-called lazy flag to the existing function 'admin.alter()' of Ruby. The command 'alter_async' also show up in Ruby as a "new command". I guess 'alter_async' followed some guidelines? |
@GeorryHuang I added a comment in the jira. IMO its good to roll "async" behavior into the actual alter command implementation. The original commit that added it is a decade old so I'm guessing very few people around here have any context of it. |
0928fa8
to
b59b96c
Compare
🎊 +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. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
4716b7f
to
e27220a
Compare
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
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.
LGTM.
I am relatively new to contributing to HBase code, so will wait for other members also to have a look.
Sorry for the delay and thanks for working on this @GeorryHuang, let me come back to the review soon as i can. @bbeaudreault if the changes look good to you in the meantime, please feel free to take it forward :) |
@@ -72,6 +72,13 @@ def help | |||
hbase> alter 't1', CONFIGURATION => {'hbase.hregion.scan.loadColumnFamiliesOnDemand' => 'true'} | |||
hbase> alter 't1', {NAME => 'f2', CONFIGURATION => {'hbase.hstore.blockingStoreFiles' => '10'}} | |||
|
|||
You can also set configuration setting with REOPEN_REGIONS=>'false' to avoid regions RIT, which |
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 also explain the type of changes that don't allow reopen=false
, such as adding/removing CFs or changing table name?
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.
Sure, I've made the changes
0 != this.unmodifiedTableDescriptor.getTableName() | ||
.compareTo(this.modifiedTableDescriptor.getTableName()) |
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.
nit: use equals
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.
fixed.
this(env, newTableDescriptor, latch, oldTableDescriptor, shouldCheckDescriptor, true); | ||
} | ||
|
||
public ModifyTableProcedure(final MasterProcedureEnv env, |
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.
since this class is IA.Private, it'd be preferable to not add a new constructor overload unless absolutely necessary. Are there few enough callers that you could simply update one of the existing constructors?
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.
Removed the new constructor I added before and altered the existing constructor instead.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ModifyTableProcedure.java
Show resolved
Hide resolved
💔 -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. |
💔 -1 overall
This message was automatically generated. |
@@ -2763,6 +2763,13 @@ protected String getDescription() { | |||
private long modifyTable(final TableName tableName, | |||
final TableDescriptorGetter newDescriptorGetter, final long nonceGroup, final long nonce, | |||
final boolean shouldCheckDescriptor) throws IOException { | |||
return modifyTable(tableName, newDescriptorGetter, nonceGroup, nonce, shouldCheckDescriptor, |
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.
I was looking into why we need this overload. I see this is called from addColumn/deleteColumn/modifyColumn. Does it make sense to add reopenRegion support to modifyColumn at least?
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 have two methods:
modifyTable(..[five parameters]..)
modifyTable(..[five parameters].., boolean reopenRegions)
The methods 'addColumn/deleteColumn/modifyColumn' that you mentioned will call method modifyTable(..[five parameters]..)
directly as before. They are not aware of the 'reopenRegions' parameter.
To make the code structure cleaner, I only changed one line in method modifyTable(..[five parameters]..)
, which then turns into modifyTable(..[five parameters].., boolean reopenRegions)
. So now, you can see that modifyTable(..[five parameters]..)
calls modifyTable(..[five parameters].., boolean reopenRegions)
with reopenRegions=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.
LGTM. I do wonder whether we should add modifyColumn support here, but not a blocker.
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.
LGTM. I do wonder whether we should add modifyColumn support here, but not a blocker.
💔 -1 overall
This message was automatically generated. |
We are good to go? |
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.
+1
} | ||
} | ||
|
||
private boolean isTablePropertyModified(TableDescriptor oldDescriptor, |
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.
nit: javadoc would be great
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.
Done.
Yes, I am going to merge it into the master branch. |
💔 -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. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
…ns when modifying a table to prevent RIT storms. (#2924) Co-authored-by: Huangzhuoyue <huangzhuoyue@apache.org> Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org> Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org> Signed-off-by: Bharath Vissapragada <bharathv@apache.org> Signed-off-by: Esteban Gutierrez <esteban@apache.org> Reviewed-by: Sean Busbey <busbey@apache.org> Reviewed-by: Gourab Taparia
Provide an optional lazy_mode for the alter command to modify the TableDescriptor without the region entering the RIT. The modification will take effect when the region is reopened.