-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29082: Support for custom meta table name suffix #6632
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| * Added in HBASE-XXXXX to support having multiple hbase:meta tables (with distinct names )to | ||
| * enable storage sharing by more than one clusters. | ||
| */ | ||
|
|
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: remove empty line
| String suffix_val = String.valueOf(conf.getStrings( | ||
| HConstants.HBASE_META_TABLE_SUFFIX, HConstants.HBASE_META_TABLE_SUFFIX_DEFAULT_VALUE)); | ||
|
|
||
| if (suffix_val == null||suffix_val.isEmpty()) { |
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.
Use proper formatting:
if (suffix_val == null || suffix_val.isEmpty()) {| LOG.debug("Default value for Hbase meta table is being chosen."); | ||
| return TableName.META_TABLE_NAME; | ||
| } | ||
| LOG.debug("Suffix value for Hbase meta table is being chosen."); |
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.
Instead of emitting 2 separate log messages, add a single one at INFO level.
LOG.info("Meta table name: {}", META_TABLE_NAME);| String suffix_val = String.valueOf(conf.getStrings( | ||
| HConstants.HBASE_META_TABLE_SUFFIX, HConstants.HBASE_META_TABLE_SUFFIX_DEFAULT_VALUE)); | ||
|
|
||
| if (suffix_val == null||suffix_val.isEmpty()) { | ||
| return TableName.META_TABLE_NAME; | ||
| } | ||
| return valueOf(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR, "meta_" | ||
| + suffix_val); |
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.
Don't duplicate the logic, put it at a common place: keep it here or in the other class, or put it in a common utility.
| Path tableDir = CommonFSUtils.getTableDir(rootDir, TableName.META_TABLE_NAME); | ||
| if (fs.exists(tableDir) && !fs.delete(tableDir, true)) { | ||
| LOG.warn("Can not delete partial created meta table, continue..."); | ||
| throw new HBaseIOException("Specified meta table already exists."); |
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.
We might not need this I believe for 2 reasons:
- we should keep the original logic here for backward compatiblity,
- you throw this exception only in the case when HBase tried to delete
tableDir, but it wasn't successful
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| public static TableName initializeHbaseMetaTableName(Configuration conf) { | ||
| String suffix_val = String.valueOf(conf.getStrings( |
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.
Meta table suffix is just a string. I think this should be conf.get(...)
| protected final Configuration conf; | ||
| public InitMetaProcedure(Configuration conf) { | ||
| this.conf = conf; | ||
| } | ||
|
|
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.
You probably don't need this constructor at all if you return TableName.META_TABLE_NAME in getTableName() method. Actually don't need to modify this class at all.
|
my patch: #6683 |
| if (suffix_val == null || suffix_val.isEmpty()) { | ||
| LOG.info("Meta table name: {}", META_TABLE_NAME); | ||
| return TableName.META_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.
This is incorrect: META_TABLE_NAME is being initialized in this method, so you end up returning null value.
f388c45 to
0462bc4
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
retest |
87203d4 to
89b52aa
Compare
7ab9d52 to
a19b106
Compare
|
The PR build had issues which are already fixed by @ndimiduk on master. See: https://issues.apache.org/jira/browse/HBASE-29163 |
|
Yep if you pull and rebase you'll have necessary fixes to the build env on all branches. |
|
@kabhishek4 I've updated the feature branch, please rebase your patch. |
(cherry picked from commit 7ab9d52)
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
Failing tests are either flaky or also failing on the master branch. We're going to raise new jira ticket to fix them. Merging this PR to move forward. |
(cherry picked from commit 7ab9d52)
(cherry picked from commit 7ab9d52)
(cherry picked from commit 7ab9d52)
Add support for custom meta table name and ability to start cluster on the same storage location.
New config setting:
hbase.meta.table.suffix default "" Adds a suffix to the meta table name: value=’test’ -> ‘hbase:meta_test’