Uh oh!
There was an error while loading. Please reload this page.
HBASE-29672 Handle runtime comparison failures during filtering gracefully - #7397
HBASE-29672 Handle runtime comparison failures during filtering gracefully#7397droudnitsky wants to merge 8 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
droudnitsky
commented
Oct 19, 2025
Code snippet to identify all filters which take ByteArrayComparable, majority (5/8) filters are an extension of CompareFilter , but there are 3 outlier ColumnValue filters which do not extend CompareFilter - |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR adds graceful error handling for runtime exceptions that occur during comparator operations in HBase filters. When a ByteArrayComparable comparator throws a RuntimeException during filtering, it now gets wrapped in an HBaseIOException with a clear error message, preventing unclear remote exceptions on the client side.
Key Changes:
- Added runtime exception handling in CompareFilter's compare methods (compareRow, compareFamily, compareQualifier, compareValue)
- Updated method signatures to throw IOException for affected filter methods
- Added comprehensive unit tests to verify exception handling across all filter types
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| CompareFilter.java | Added wrapInHBaseIOException utility method and try-catch blocks to wrap RuntimeExceptions in all compare methods |
| ValueFilter.java | Updated filterCell method signature to throw IOException |
| SingleColumnValueFilter.java | Updated filterCell and filterColumnValue signatures and added exception wrapping |
| RowFilter.java | Updated filterRowKey method signature to throw IOException |
| QualifierFilter.java | Updated filterCell method signature to throw IOException |
| FamilyFilter.java | Updated filterCell method signature to throw IOException |
| DependentColumnFilter.java | Updated filterCell method signature to throw IOException |
| ColumnValueFilter.java | Updated private compareValue method signature and added exception wrapping |
| TestFiltersWithComparatorException.java | New comprehensive test suite with BadComparator to verify exception handling across all filter types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Apache9
commented
Nov 27, 2025
Please fix the typo? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…FiltersWithComparatorException.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…FiltersWithComparatorException.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Apache9
commented
Nov 29, 2025
@droudnitsky Not all the copilot comments need to be addressed... Let me take a look again. |
Apache9
left a comment
There was a problem hiding this comment.
Overall LGTM.
Will be good if we can migrate the test to use junit 5.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Apache-HBase
commented
Nov 29, 2025
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Nov 29, 2025
🎊 +1 overall
This message was automatically generated. |
droudnitsky
commented
Dec 24, 2025
Thank you very much for reviewing @Apache9 ! I have migrated the test to junit 5. I believe this patch is also good to be back-ported to 2.x , in terms of client compatibility we are still throwing |
Apache9
commented
Dec 25, 2025
Please open a PR against branch-2, usually the patch for branch-2 can be applied to other 2.x branches cleanly. And please fix the error prone warning if possible. Thanks. |
droudnitsky
commented
Feb 18, 2026
Thank you @Apache9 , I will open a PR for branch-2. The error prone warning was generated for a class I did not modify, I can fix it, should that be done in seperate PR since its unrelated to this ? |
noslowerdna
commented
Jul 17, 2026
LGTM |
https://issues.apache.org/jira/browse/HBASE-29672
There is a large class of filters:
RowFilter
ValueFilter
QualifierFilter
FamilyFilter
DependentColumnFilter
ColumnValueFilter
SingleColumnValueFilter
SingleColumnValueExcludeFilter
Which take a ByteArrayComparable comparator as an argument (e.g BinaryComparator, RegexStringComparator, BinaryComponentComparator) and apply the given comparator at query runtime on the server. Due to filter misconfiguration/data shape/comparator bugs, a comparator may throw a runtime exception which filters are not currently handling. In this case the runtime exception gets propagated all the way up the call stack, leading to an unexpected throwable at the topmost RpcServer layer and a very unclear remote exception on the client with a very long mysterious server exception trace.
This PR adds runtime exception handling for comparator runtime exceptions and treats them as HBaseIOException, and propagate a clear exception message to the client. This approach will also lets us handle cases where we know that a client retry is guaranteed to fail and let us prevent bad requests from being excessively retried (such as HBASE-29654).
Some context/discussion in #7389