Skip to content

HBASE-28828 Should check if table exists firstly when executing ExpiredMobFileCleaner#6231

Closed
guluo2016 wants to merge 2 commits into
apache:masterfrom
guluo2016:hbase_HBASE-28828
Closed

HBASE-28828 Should check if table exists firstly when executing ExpiredMobFileCleaner#6231
guluo2016 wants to merge 2 commits into
apache:masterfrom
guluo2016:hbase_HBASE-28828

Conversation

@guluo2016
Copy link
Copy Markdown
Member

Details see: HBASE-28828

ColumnFamilyDescriptor family = htd.getColumnFamily(Bytes.toBytes(familyName));
if (family == null || !family.isMobEnabled()) {
if (family == null) {
throw new IOException("Column family " + familyName + " doesn't exist");
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When column family does not exist, we provide accurate information in here

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

if (!admin.tableExists(tn)) {
throw new IOException("The table " + tableName + " doesn't exist");
}
TableDescriptor htd = admin.getDescriptor(tn);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think getDescriptor will lead to a TableNotFoundException, which is the same here? TableNotFOundException is an IOException?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, admin.getDescriptor would throw TableNotFoundException when table doesn't exist.
In here, What I mean is that we provide clear and concise information about that table doesn't exist, as following, maybe this would be better?

./bin/hbase org.apache.hadoop.hbase.mob.ExpiredMobFileCleaner  t01 in
2024-09-15T14:02:26,263 WARN  [main {}] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2024-09-15T14:02:26,940 INFO  [RPCClient-NioEventLoopGroup-1-2 {}] Configuration.deprecation: hbase.client.pause.cqtbe is deprecated. Instead, use hbase.client.pause.server.overloaded
2024-09-15T14:02:27,040 INFO  [main {}] client.AsyncConnectionImpl: Connection has been closed by main.
Exception in thread "main" java.io.IOException: The table t01 doesn't exist
        at org.apache.hadoop.hbase.mob.ExpiredMobFileCleaner.run(ExpiredMobFileCleaner.java:99)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:82)
        at org.apache.hadoop.hbase.mob.ExpiredMobFileCleaner.main(ExpiredMobFileCleaner.java:75)
2024-09-15T14:02:27,050 INFO  [Registry-endpoints-refresh-end-points {}] client.RegistryEndpointsRefresher: Registry end points refresher loop exited.

If we donot do this, when table does not exist, we will get the follow message.

Exception in thread "main" org.apache.hadoop.hbase.TableNotFoundException: t04_mob01
        at java.base/java.lang.Thread.getStackTrace(Thread.java:1610)
        at org.apache.hadoop.hbase.util.FutureUtils.setStackTrace(FutureUtils.java:144)
        at org.apache.hadoop.hbase.util.FutureUtils.rethrow(FutureUtils.java:163)
        at org.apache.hadoop.hbase.util.FutureUtils.get(FutureUtils.java:186)
        at org.apache.hadoop.hbase.client.AdminOverAsyncAdmin.getDescriptor(AdminOverAsyncAdmin.java:172)
        at org.apache.hadoop.hbase.mob.ExpiredMobFileCleaner.run(ExpiredMobFileCleaner.java:99)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:82)
        at org.apache.hadoop.hbase.mob.ExpiredMobFileCleaner.main(ExpiredMobFileCleaner.java:75)
        at -------Future.get-------(Unknown Source)
        at org.apache.hadoop.hbase.client.RawAsyncHBaseAdmin.lambda$getDescriptor$24(RawAsyncHBaseAdmin.java:654)
        at org.apache.hadoop.hbase.util.FutureUtils.lambda$addListener$0(FutureUtils.java:71)
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
        at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
        at org.apache.hadoop.hbase.client.AsyncMasterRequestRpcRetryingCaller.lambda$doCall$4(AsyncMasterRequestRpcRetryingCaller.java:80)
        at org.apache.hadoop.hbase.util.FutureUtils.lambda$addListener$0(FutureUtils.java:71)
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
        at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
        at org.apache.hadoop.hbase.client.RawAsyncHBaseAdmin$1.run(RawAsyncHBaseAdmin.java:467)
        at org.apache.hbase.thirdparty.com.google.protobuf.RpcUtil$1.run(RpcUtil.java:56)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with mob, why the table name changed to t04_mob01 from t01?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, I didnot change table name

I just used 2 examples in here.
The first example, i specfied a non_existing table named t01

./bin/hbase org.apache.hadoop.hbase.mob.ExpiredMobFileCleaner  t01 in

The second example , i specfied a non_existing table named t04_mob

./bin/hbase org.apache.hadoop.hbase.mob.ExpiredMobFileCleaner  t04_mob in

In addition, to execute ExpiredMobFileCleaner , two parameters need to be specified, table name and column family

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the table name will be changed from t04_mob to t04_mob01? This is the problem here? Where do we do this convertion?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then back to my very first comment here, the old logic seems enough to indicate that the table does not exist? We do not need an extra table exists check?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, admin.getDescriptor(tn) would throw TNFE when the table does not exist.

As I mentioned before,this commit is order to optimize this exception messge, providing clear and concise information

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think java.io.IOException: The table non_existing_table doesn't exist is more clear than org.apache.hadoop.hbase.TableNotFoundException: non_existing_table...

They are just the same...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are just the same...

Yes, let me close this PR later.
Thank you very much for your patient review.

@Apache-HBase
Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 26s 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.
_ master Compile Tests _
+1 💚 mvninstall 3m 19s master passed
+1 💚 compile 3m 5s master passed
+1 💚 checkstyle 0m 36s master passed
+1 💚 spotbugs 1m 34s master passed
+1 💚 spotless 0m 45s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 11s the patch passed
+1 💚 compile 3m 3s the patch passed
+1 💚 javac 3m 3s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 35s the patch passed
+1 💚 spotbugs 1m 39s the patch passed
+1 💚 hadoopcheck 11m 30s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 spotless 0m 43s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 11s The patch does not generate ASF License warnings.
37m 49s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6231/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #6231
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux 882a9f1df1d6 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 master / bcfba73
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 83 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6231/2/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.

@Apache-HBase
Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 27s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 3m 14s master passed
+1 💚 compile 1m 4s master passed
+1 💚 javadoc 0m 29s master passed
+1 💚 shadedjars 5m 45s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 9s the patch passed
+1 💚 compile 0m 57s the patch passed
+1 💚 javac 0m 57s the patch passed
+1 💚 javadoc 0m 27s the patch passed
+1 💚 shadedjars 5m 41s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌ unit 213m 46s /patch-unit-hbase-server.txt hbase-server in the patch failed.
239m 54s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6231/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #6231
Optional Tests javac javadoc unit compile shadedjars
uname Linux a2e3c45675c1 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 master / bcfba73
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6231/2/testReport/
Max. process+thread count 5512 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6231/2/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@guluo2016 guluo2016 closed this Sep 19, 2024
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.

4 participants