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-28187 NPE when flushing a non-existing column family #5692

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

guluo2016
Copy link
Contributor

Details see: HBASE-28187

And even worse, although this flush can be terminated by exception or manually,we are still unable to operate this region because of RegionTooBusyException.

@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.

"There are non-existing families %s, we cannot flush the region %s, in table %s.",
noSuchFamilies, getRegionInfo().getRegionNameAsString(),
getTableDescriptor().getTableName().getNameAsString());
LOG.warn(noSuchFamiliesMsg);
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this should log at all. It's essentially an HTTP 400 kind of situation. Maybe a TRACE log, if at all. By all means, send the message back to the client, but i don't think the RS needs to emit this message.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also think the log here is unnecessary too. If you want to log this to trace bad requests, RegionServer will log some key information for FlushRegionRequest and ExecuteProceduresRequest. Is it possible to merge the information here into that log?

}
});
TableName tableName = location.getRegion().getTable();
addListener(getDescriptor(tableName), (tDesc, error2) -> {
Copy link
Member

Choose a reason for hiding this comment

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

See above about introducing the additional RPC.

IMHO, the client should be dumber, not smarter. I'd rather see the NoSuchColumnFamilyException come from the RS than the client.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree. I think an NoSuchColumnFamilyException here would be better too.

CompletableFuture<Void> future = new CompletableFuture<>();
addListener(procFuture, (ret, error) -> {
addListener(getDescriptor(tableName), (tDesc, error) -> {
Copy link
Member

Choose a reason for hiding this comment

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

Introducing getDescriptors introduces an additional RPC. I think we shouldn't do this, only to do validation on client-side. Instead please post the original message and let the server validate it. If we had some client-side cache of the descriptor, we could do a pre-validation on that, but even then, caches are lossy and probably shouldn't be relied upon for something that the server is already the authority.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will refactor this part of the code later based on your good suggestions
Thank you both for your review

@guluo2016 guluo2016 force-pushed the hbase_HBASE-28187 branch 2 times, most recently from 58b7960 to 77e0934 Compare September 20, 2024 12:00
@Apache-HBase

This comment has been minimized.

@guluo2016
Copy link
Contributor Author

I hava already refactor these code, please review, thanks. @ndimiduk @frostruan @Apache9

Summary:

flush 'table', 'non_existing_family'

Flush Procedure is enabled.

we would check if the column families exist when executing FlushTableProcedure, and throwing NoSuchColumnFamilyException if it doesn't exist. And we will not retry to flush again at client side.

Flush Procedure is disabled.

we would check if the column families exist on MasterFlushTableProcedureManager.execProcedure(), and throwing NoSuchColumnFamilyException if it doesn't exist.

flush 'region_name', 'non_existing_family'

we would check if the column families exist on RSRpcServices.flushRegion(), and throwing NoSuchColumnFamilyException if it doesn't exist.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@frostruan
Copy link
Contributor

LGTM. +1

Copy link
Member

@ndimiduk ndimiduk left a comment

Choose a reason for hiding this comment

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

This looks better. Thanks @guluo2016 .

@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 35s 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 _
+0 🆗 mvndep 0m 12s Maven dependency ordering for branch
+1 💚 mvninstall 3m 15s master passed
+1 💚 compile 3m 54s master passed
+1 💚 checkstyle 0m 52s master passed
+1 💚 spotbugs 2m 16s master passed
+1 💚 spotless 0m 46s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 3m 5s the patch passed
+1 💚 compile 3m 51s the patch passed
+1 💚 javac 3m 51s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 54s the patch passed
+1 💚 spotbugs 2m 31s the patch passed
+1 💚 hadoopcheck 11m 33s 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 17s The patch does not generate ASF License warnings.
42m 8s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5692/6/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #5692
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux 0913f5845d1b 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 / 8909436
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 83 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5692/6/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

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 25s Docker mode activated.
-0 ⚠️ yetus 0m 2s 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 _
+0 🆗 mvndep 0m 10s Maven dependency ordering for branch
+1 💚 mvninstall 3m 15s master passed
+1 💚 compile 1m 18s master passed
+1 💚 javadoc 0m 44s master passed
+1 💚 shadedjars 5m 44s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for patch
+1 💚 mvninstall 3m 6s the patch passed
+1 💚 compile 1m 18s the patch passed
+1 💚 javac 1m 18s the patch passed
+1 💚 javadoc 0m 42s the patch passed
+1 💚 shadedjars 5m 42s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 1m 36s hbase-client in the patch passed.
+1 💚 unit 231m 44s hbase-server in the patch passed.
260m 48s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5692/6/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #5692
Optional Tests javac javadoc unit compile shadedjars
uname Linux 0b35c99d6e54 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 / 8909436
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5692/6/testReport/
Max. process+thread count 4967 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5692/6/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.

@ndimiduk ndimiduk merged commit 449c446 into apache:master Sep 24, 2024
1 check passed
ndimiduk pushed a commit to ndimiduk/hbase that referenced this pull request Sep 24, 2024
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Hui Ruan <huiruan@apache.org>
ndimiduk pushed a commit to ndimiduk/hbase that referenced this pull request Sep 24, 2024
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Hui Ruan <huiruan@apache.org>
ndimiduk pushed a commit to ndimiduk/hbase that referenced this pull request Sep 24, 2024
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Hui Ruan <huiruan@apache.org>
ndimiduk pushed a commit that referenced this pull request Sep 25, 2024
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Hui Ruan <huiruan@apache.org>
ndimiduk pushed a commit to ndimiduk/hbase that referenced this pull request Sep 25, 2024
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Hui Ruan <huiruan@apache.org>
ndimiduk pushed a commit to ndimiduk/hbase that referenced this pull request Sep 25, 2024
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Hui Ruan <huiruan@apache.org>
ndimiduk added a commit that referenced this pull request Sep 26, 2024
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Hui Ruan <huiruan@apache.org>
Co-authored-by: Peng Lu <lupeng_nwpu@qq.com>
ndimiduk added a commit that referenced this pull request Sep 26, 2024
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Hui Ruan <huiruan@apache.org>
Co-authored-by: Peng Lu <lupeng_nwpu@qq.com>
@guluo2016 guluo2016 deleted the hbase_HBASE-28187 branch October 9, 2024 06:17
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