Skip to content
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-29082: Support for custom meta table name suffix #6632

Open
wants to merge 1 commit into
base: HBASE-29081
Choose a base branch
from

Conversation

kabhishek4
Copy link
Contributor

No description provided.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

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.
*/

Copy link
Contributor

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()) {
Copy link
Contributor

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()) {

Comment on lines 86 to 89
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.");
Copy link
Contributor

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);

Comment on lines 75 to 82
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);
Copy link
Contributor

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.

@@ -78,6 +94,7 @@ private static TableDescriptor writeFsLayout(Path rootDir, Configuration conf)
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.");
Copy link
Contributor

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

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

}

public static TableName initializeHbaseMetaTableName(Configuration conf) {
String suffix_val = String.valueOf(conf.getStrings(
Copy link
Contributor

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(...)

Comment on lines 67 to 71
protected final Configuration conf;
public InitMetaProcedure(Configuration conf) {
this.conf = conf;
}

Copy link
Contributor

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.

@anmolnar
Copy link
Contributor

my patch: #6683

Comment on lines 94 to 99
if (suffix_val == null || suffix_val.isEmpty()) {
LOG.info("Meta table name: {}", META_TABLE_NAME);
return TableName.META_TABLE_NAME;
}
Copy link
Contributor

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.

@kabhishek4 kabhishek4 force-pushed the rorep branch 2 times, most recently from f388c45 to 0462bc4 Compare February 24, 2025 16:19
@anmolnar anmolnar marked this pull request as ready for review February 24, 2025 17:54
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 29s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ HBASE-29081 Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for branch
+1 💚 mvninstall 3m 11s HBASE-29081 passed
+1 💚 compile 3m 47s HBASE-29081 passed
+1 💚 checkstyle 0m 49s HBASE-29081 passed
+1 💚 spotbugs 2m 1s HBASE-29081 passed
+1 💚 spotless 0m 45s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 3m 1s the patch passed
+1 💚 compile 3m 39s the patch passed
+1 💚 javac 3m 39s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 52s the patch passed
+1 💚 spotbugs 2m 15s the patch passed
+1 💚 hadoopcheck 11m 29s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 spotless 0m 42s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 17s The patch does not generate ASF License warnings.
41m 1s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6632/8/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #6632
JIRA Issue HBASE-29082
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux 3a878797384b 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision HBASE-29081 / 08a65ab
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 84 (vs. ulimit of 30000)
modules C: hbase-common hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6632/8/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants