-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29691: Change TableName.META_TABLE_NAME from being a global static #7558
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
base: master
Are you sure you want to change the base?
Conversation
…tic: org.apache.hadoop.hbase
…tic: org.apache.hadoop.hbase.client
…tic: org.apache.hadoop.hbase.master
…tic: org.apache.hadoop.hbase.regionserver
…tic: fix spotless
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
Apache9
left a comment
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 do not think this is the correct way, at least you should not let clients config meta table name right? They should ask the meta table name from bootstrap node.
Theoretically, we can even support changing meta table name at runtime, clients and region servers can ask meta table name from master when they hit table not found exception when accessing meta.
And if we think this is a bit difficult to implement, and maybe there is no need to change meta table name after initialization, then maybe we can introduce a config to set meta table name when bootstraping a cluster, then we record this name in master local region or on HDFS directly. But anyway, clients and region servers still need to ask for the meta table name from master, not from configuration. But they just do not need to deal with meta table name change when running.
Thanks.
| if (instance == null) { | ||
| synchronized (MetaTableName.class) { | ||
| if (instance == null) { | ||
| instance = initializeHbaseMetaTableName(HBaseConfiguration.create()); |
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 do not think this is a good practise, as this is still static, what if a client wants to connect different read replica clusters? And it will difficult to write UTs when you want to set up two clusters with different meta table names...
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 do not think this is a good practise, as this is still static
I agree, this does not change the static referring.
what if a client wants to connect different read replica clusters?
Could clients use different configurations for each cluster being accessed?
Could be as simple as the hbase.id approach (a single file under the root dir containing the meta suffix generated during bootstrap)? Then all processes would load that file when initialising? |
| private static TableName initializeHbaseMetaTableName(Configuration conf) { | ||
| TableName metaTableName = | ||
| TableName.valueOf(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR, "meta"); | ||
| LOG.info("Meta table suffix value: {}", metaTableName); | ||
| return metaTableName; |
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.
Where is the conf being used here? And the suffix?
| if (instance == null) { | ||
| synchronized (MetaTableName.class) { | ||
| if (instance == null) { | ||
| instance = initializeHbaseMetaTableName(HBaseConfiguration.create()); |
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 do not think this is a good practise, as this is still static
I agree, this does not change the static referring.
what if a client wants to connect different read replica clusters?
Could clients use different configurations for each cluster being accessed?
|
Shall we add meta table name to ZooKeeper quorums will be distinct between replica clusters, so it could be a good place to store meta table name during the bootstrap process. We don't need to support changing it in runtime. For instance, in cluster bootstrap process:
wdyt? |
|
Let's not introduce new persistent data on zookeeper, we could store it on HDFS on in the master local region. Maybe we should introduce a shell command like 'add_read_replica_cluster xxx' and execute it at the primary cluster, the primary cluster will generate the meta name suffix file or record for read replica clusters. |
HDFS won't be sufficient, because it's shared between the clusters. Could be in master local region, but that doesn't contradict with making it accessible via |
We coud use different file names for different read replica clusters? |
So basically, we read from the config: and create a file on HDFS: ? |
Was thinking of this approach. But after considering, if we could use different master local region for different HBase read replicas, we could just store this value in master local region? In this way the primary cluster does not need to know the read replicas. Maybe this is better? |
Jira: https://issues.apache.org/jira/browse/HBASE-29691