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-28621 PrefixFilter should use SEEK_NEXT_USING_HINT #6361

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

PDavid
Copy link
Contributor

@PDavid PDavid commented Oct 9, 2024

No description provided.

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

@PDavid PDavid marked this pull request as ready for review October 10, 2024 08:52
Comment on lines -53 to -56
if (firstRowCell == null || this.prefix == null) return true;
if (filterAllRemaining()) return true;
if (firstRowCell == null || this.prefix == null) {
return true;
}
if (filterAllRemaining()) {
return true;
}
int length = firstRowCell.getRowLength();
if (length < prefix.length) return true;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are actually not strictly required to resolve the ticket. Just the checkstyle report contained these warnings:

(blocks) NeedBraces: 'if' construct must use '{}'s.
(blocks) NeedBraces: 'if' construct must use '{}'s.
(blocks) NeedBraces: 'if' construct must use '{}'s.
(blocks) NeedBraces: 'if' construct must use '{}'s.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually this if looks buggy.
If the firstRowCell is lexicographically smaller than the prefix, then we still want to provide the hint, regardless of the key length.

We can probably just drop this, I believe that the compare later will also handle this case.
This was supposed to be an optization, but it is not relevant when we provide hints, and in fact hurts performance.

Please fix and also add test cases for this.

@@ -40,7 +43,6 @@ public class TestPrefixFilter {
static final char FIRST_CHAR = 'a';
static final char LAST_CHAR = 'e';
static final String HOST_PREFIX = "org.apache.site-";
static final byte[] GOOD_BYTES = Bytes.toBytes("abc");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is also a bit unrelated - an unused constant field.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@PDavid PDavid marked this pull request as draft October 14, 2024 08:10
@stoty
Copy link
Contributor

stoty commented Oct 14, 2024

please remove the colon from the commit message / PR description

@PDavid PDavid changed the title HBASE-28621: PrefixFilter should use SEEK_NEXT_USING_HINT HBASE-28621 PrefixFilter should use SEEK_NEXT_USING_HINT Oct 14, 2024
@PDavid PDavid force-pushed the HBASE-28621-PrefixFilter-SEEK_NEXT_USING_HINT branch from 09fc843 to 02ed23a Compare October 14, 2024 12:38
@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.

Comment on lines -53 to -56
if (firstRowCell == null || this.prefix == null) return true;
if (filterAllRemaining()) return true;
if (firstRowCell == null || this.prefix == null) {
return true;
}
if (filterAllRemaining()) {
return true;
}
int length = firstRowCell.getRowLength();
if (length < prefix.length) return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually this if looks buggy.
If the firstRowCell is lexicographically smaller than the prefix, then we still want to provide the hint, regardless of the key length.

We can probably just drop this, I believe that the compare later will also handle this case.
This was supposed to be an optization, but it is not relevant when we provide hints, and in fact hurts performance.

Please fix and also add test cases for this.

@Apache-HBase

This comment has been minimized.

@@ -77,7 +77,7 @@ public boolean filterRowKey(Cell firstRowCell) {
if ((!isReversed() && cmp > 0) || (isReversed() && cmp < 0)) {
passedPrefix = true;
}
filterRow = (!isReversed() && cmp > 0) || (isReversed() && cmp < 0);
filterRow = (!isReversed() && cmp > 0) || (isReversed() && cmp != 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

This change looks fishy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Completely agree. But this fixes the previously failing TestFilter.testPrefixFilterWithReverseScan unit test. 😅

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 28s 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 18s Maven dependency ordering for branch
+1 💚 mvninstall 2m 52s master passed
+1 💚 compile 3m 40s master passed
+1 💚 checkstyle 0m 49s master passed
-1 ❌ spotbugs 1m 29s /branch-spotbugs-hbase-server-warnings.html hbase-server in master has 1 extant spotbugs warnings.
+1 💚 spotless 0m 41s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 2m 50s the patch passed
+1 💚 compile 3m 45s the patch passed
+1 💚 javac 3m 45s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 14s hbase-client: The patch generated 0 new + 0 unchanged - 5 fixed = 0 total (was 5)
+1 💚 checkstyle 0m 34s The patch passed checkstyle in hbase-server
+1 💚 spotbugs 2m 21s the patch passed
+1 💚 hadoopcheck 10m 49s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 spotless 0m 41s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 16s The patch does not generate ASF License warnings.
39m 35s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6361/7/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #6361
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux 393a6a96a2bb 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 / 5085fd8
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 84 (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-6361/7/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 26s 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 _
+0 🆗 mvndep 0m 29s Maven dependency ordering for branch
+1 💚 mvninstall 3m 17s master passed
+1 💚 compile 1m 17s master passed
+1 💚 javadoc 0m 44s master passed
+1 💚 shadedjars 5m 41s 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 3s the patch passed
+1 💚 compile 1m 17s the patch passed
+1 💚 javac 1m 17s the patch passed
+1 💚 javadoc 0m 43s 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 212m 48s hbase-server in the patch passed.
241m 41s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6361/7/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #6361
Optional Tests javac javadoc unit compile shadedjars
uname Linux 99972866feca 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 / 5085fd8
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6361/7/testReport/
Max. process+thread count 5274 (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-6361/7/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.

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