Skip to content

HBASE-28634 Fix FuzzyRowFilter may not return data on reverse scans - #6457

Merged
stoty merged 9 commits into
apache:masterfrom
PDavid:HBASE-28634-FuzzyRowFilter-reverse-no-data
Nov 25, 2024
Merged

HBASE-28634 Fix FuzzyRowFilter may not return data on reverse scans#6457
stoty merged 9 commits into
apache:masterfrom
PDavid:HBASE-28634-FuzzyRowFilter-reverse-no-data

Conversation

@PDavid

@PDavidPDavid commented Nov 11, 2024

Copy link
Copy Markdown
Contributor

The FuzzyRowFilter reverse scan related code was added under HBASE-12183.

My Changes:

  • Reproduced the issue with a mini cluster test.
  • Corrected reverse unit tests in TestFuzzyRowFilter as some expectations were not correct.
  • Fixed hint returned by FuzzyRowFilter.getNextForFuzzyRule() in the reverse case:
    • Before we only trimmed the trailing zeros from the hint in the forward scan case. From now on we also do this in the reverse case.
      • Also extracted PrefixFilter.increaseLastNonMaxByte() method to PrivateCellUtil so that it can be reused in FuzzyRowFilter.
    • When the hint should contain a 0xFF. As a start, when we have a reverse scan, we not only need trailing 0xff's instead of trailing 0x00's, but it seems we always need 0xff's instead of the 0x00's.
  • Made some small improvements to FuzzyRowFilter which IntelliJ IDEA suggested (final fields, simplifications).

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@PDavid
PDavidforce-pushed the HBASE-28634-FuzzyRowFilter-reverse-no-data branch from 9abb459 to ed2e4a5CompareNovember 12, 2024 14:30
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@PDavid

Copy link
Copy Markdown
ContributorAuthor

In the latest PR build two unit tests failed:

  • TestMasterFailoverBalancerPersistence
  • TestRegionServerReportForDuty

For me, these look unrelated and I was able to successfully run these tests locally.

@PDavid
PDavid marked this pull request as ready for review November 13, 2024 08:21
@PDavid
PDavidforce-pushed the HBASE-28634-FuzzyRowFilter-reverse-no-data branch from ed2e4a5 to c03e416CompareNovember 13, 2024 09:39
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

Reproduced the issue with a mini cluster test.
Some expectations were not correct.
Also extracted PrefixFilter.increaseLastNonMaxByte() method to PrivateCellUtil so that it can be reused in FuzzyRowFilter.
…() when the hint should contain a 0xFF
As a start, when we have a reverse scan, we not only need trailing 0xff's instead of trailing 0x00's, but it seems we always need 0xff's instead of the 0x00's.
to not start another minicluster needlessly.
@PDavid
PDavidforce-pushed the HBASE-28634-FuzzyRowFilter-reverse-no-data branch from c03e416 to 348b364CompareNovember 18, 2024 09:00

@stotystoty left a comment

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.

+1 LGTM

@Override
public ReturnCode filterCell(final Cell c) {
final int startIndex = lastFoundIndex >= 0 ? lastFoundIndex : 0;
final int startIndex = Math.max(lastFoundIndex, 0);

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 have checked, this compiles to the same inline, so it's not a performance problem.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Many thanks. 👍
Yes, this line change was not because of performance. Actually here just IntelliJ IDEA suggested to replace this to make it simpler to understand. It can be reverted if needed.

@stoty

Copy link
Copy Markdown
Contributor

Thank you.
Please also create a backport PR for branch-2.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

As the comment did not make much sense without the mask and current row.
@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 17sDocker 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 16sMaven dependency ordering for branch
+1 💚mvninstall2m 56smaster passed
+1 💚compile4m 23smaster passed
+1 💚checkstyle1m 11smaster passed
+1 💚spotbugs2m 50smaster passed
+1 💚spotless0m 44sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall2m 53sthe patch passed
+1 💚compile4m 26sthe patch passed
+1 💚javac4m 26sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle1m 11sthe patch passed
+1 💚spotbugs3m 10sthe patch passed
+1 💚hadoopcheck10m 12sPatch 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 31sThe patch does not generate ASF License warnings.
42m 35s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6457/6/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6457
Optional Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
unameLinux d04708389e7c 5.4.0-200-generic #220-Ubuntu SMP Fri Sep 27 13:19:16 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 9cacc58
Default JavaEclipse Adoptium-17.0.11+9
Max. process+thread count84 (vs. ulimit of 30000)
modulesC: hbase-common hbase-client hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6457/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.

@PDavid

Copy link
Copy Markdown
ContributorAuthor

Prepared a backport PR for branch-2 here: #6482

@stoty
stoty merged commit a735eff into apache:masterNov 25, 2024
stoty pushed a commit that referenced this pull request Nov 25, 2024
…6457)
Signed-off-by: Istvan Toth <stoty@apache.org>
(cherry picked from commit a735eff)
@PDavid
PDavid deleted the HBASE-28634-FuzzyRowFilter-reverse-no-data branch November 25, 2024 09:03
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.

3 participants

@PDavid@Apache-HBase@stoty