Skip to content

HBASE-30226 Avoid same-row reverse FuzzyRowFilter hints#8360

Open
EungsopYoo wants to merge 1 commit into
apache:masterfrom
EungsopYoo:HBASE-30226
Open

HBASE-30226 Avoid same-row reverse FuzzyRowFilter hints#8360
EungsopYoo wants to merge 1 commit into
apache:masterfrom
EungsopYoo:HBASE-30226

Conversation

@EungsopYoo

@EungsopYoo EungsopYoo commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Why

Reverse FuzzyRowFilter can stop making progress when the reverse seek hint is equal to the current row. See HBASE-30226 for the detailed reproduction and analysis.

What

This PR keeps the HBASE-28634 reverse hint adjustment for the normal case, but avoids returning the adjusted hint when it is equal to the current row.

It also adds an end-to-end regression test for the abc -> abb -> aaa reverse scan case.

Test plan

mvn -pl hbase-server -am
-Dtest=TestFuzzyRowFilter,TestFuzzyRowFilterEndToEnd,TestFuzzyRowFilterEndToEndLarge,TestFuzzyRowAndColumnRangeFilter,TestFilterSerialization
-DexcludedGroups=slow -Dwarbucks.skip=true test

Result: Tests run: 68, Failures: 0, Errors: 0, Skipped: 0

mvn -pl hbase-rest -am -Dtest=TestScannersWithFilters -DexcludedGroups=slow -Dwarbucks.skip=true test

Result: Tests run: 12, Failures: 0, Errors: 0, Skipped: 0

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a reverse-scan edge case in FuzzyRowFilter where a reverse seek hint can equal the current row, causing the scan to stop making progress (HBASE-30226). It refines the reverse-hint adjustment logic and adds a regression test to cover the problematic reverse scan sequence.

Changes:

  • Prevent returning an adjusted reverse hint when it equals the current row, returning the unadjusted candidate instead.
  • Update unit test expectations for reverse getNextForFuzzyRule behavior to reflect the new non-stalling hint.
  • Add an end-to-end regression test covering the abc -> abb -> aaa reverse scan progression case.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java Adjust reverse hint computation to avoid same-row hints that can stall reverse scans.
hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowFilter.java Update reverse hint unit test expectations to ensure hints move backward when needed.
hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowFilterEndToEnd.java Add an end-to-end regression test for reverse scan progress under FuzzyRowFilter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 265 to +268
assertNext(true, new byte[] { 0, 1, 0, 0 }, // fuzzy row
new byte[] { 0, -1, 0, 0 }, // mask
new byte[] { 5, 1, (byte) 255, 1 }, // current
new byte[] { 5, 1, (byte) 255, 1 }); // expected next
new byte[] { 5, 1, (byte) 255, 0 }); // expected next
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