Skip to content

HBASE-28187 NPE when flushing a non-existing column family - #5692

Merged
ndimiduk merged 1 commit into
apache:masterfrom
guluo2016:hbase_HBASE-28187
Sep 24, 2024
Merged

HBASE-28187 NPE when flushing a non-existing column family#5692
ndimiduk merged 1 commit into
apache:masterfrom
guluo2016:hbase_HBASE-28187

Conversation

@guluo2016

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

(resp) -> resp.getProcId(), new FlushTableProcedureBiConsumer(tableName));
CompletableFuture<Void> future = new CompletableFuture<>();
addListener(procFuture, (ret, error) -> {
addListener(getDescriptor(tableName), (tDesc, error) -> {

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
guluo2016force-pushed the hbase_HBASE-28187 branch 2 times, most recently from 58b7960 to 77e0934CompareSeptember 20, 2024 12:00
@Apache-HBase

This comment has been minimized.

@guluo2016

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

LGTM. +1

@ndimidukndimiduk left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 35sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
_ master Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for branch
+1 💚mvninstall3m 15smaster passed
+1 💚compile3m 54smaster passed
+1 💚checkstyle0m 52smaster passed
+1 💚spotbugs2m 16smaster passed
+1 💚spotless0m 46sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall3m 5sthe patch passed
+1 💚compile3m 51sthe patch passed
+1 💚javac3m 51sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 54sthe patch passed
+1 💚spotbugs2m 31sthe patch passed
+1 💚hadoopcheck11m 33sPatch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚spotless0m 43spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 17sThe patch does not generate ASF License warnings.
42m 8s
SubsystemReport/Notes
DockerClientAPI=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 Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 8909436
Default JavaEclipse Adoptium-17.0.11+9
Max. process+thread count83 (vs. ulimit of 30000)
modulesC: hbase-client hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5692/6/console
versionsgit=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 25sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed 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 🆗mvndep0m 10sMaven dependency ordering for branch
+1 💚mvninstall3m 15smaster passed
+1 💚compile1m 18smaster passed
+1 💚javadoc0m 44smaster passed
+1 💚shadedjars5m 44sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for patch
+1 💚mvninstall3m 6sthe patch passed
+1 💚compile1m 18sthe patch passed
+1 💚javac1m 18sthe patch passed
+1 💚javadoc0m 42sthe patch passed
+1 💚shadedjars5m 42spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit1m 36shbase-client in the patch passed.
+1 💚unit231m 44shbase-server in the patch passed.
260m 48s
SubsystemReport/Notes
DockerClientAPI=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 Testsjavac javadoc unit compile shadedjars
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 8909436
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5692/6/testReport/
Max. process+thread count4967 (vs. ulimit of 30000)
modulesC: hbase-client hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5692/6/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@ndimiduk
ndimiduk merged commit 449c446 into apache:masterSep 24, 2024
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 freeto 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

@guluo2016@Apache-HBase@frostruan@ndimiduk