-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29526 Dynamic configuration not working for coprocessor #7506
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
base: branch-2
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This problem only affects branch-2.x? |
There was a problem hiding this comment.
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 fixes HBASE-29526, addressing an issue where dynamic configuration changes for coprocessors were not being detected properly. The root cause was that the previous implementation compared old and new configuration objects, which failed when the configuration object was mutated in place (as happens during runtime configuration reloads).
Key changes:
- Replaced configuration object comparison with a comparison of currently loaded coprocessors versus newly configured coprocessors
- Added
getCoprocessorClassNames()method to CoprocessorHost to retrieve fully-qualified class names of loaded coprocessors - Updated tests to use the server's own configuration object, properly simulating dynamic configuration reload behavior
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| hbase-server/src/main/java/org/apache/hadoop/hbase/util/CoprocessorConfigurationUtil.java | Refactored checkConfigurationChange to compare loaded coprocessors against configuration values instead of comparing two configuration objects; added helper method to check if coprocessors are configured |
| hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java | Added getCoprocessorClassNames() method to retrieve fully-qualified class names of all loaded coprocessors for comparison |
| hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java | Updated to pass coprocessor host instead of old configuration to checkConfigurationChange |
| hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java | Updated to pass coprocessor host instead of old configuration to checkConfigurationChange |
| hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java | Updated to pass coprocessor host instead of old configuration; removed initializeCoprocessorHost helper method in favor of direct instantiation |
| hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerOnlineConfigChange.java | Updated tests to use the server's own configuration object (via getConfiguration()) instead of the test utility's configuration, correctly simulating dynamic configuration reload |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (coprocessors != null && coprocessors.length > 0) { | ||
| return true; |
Copilot
AI
Dec 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hasCoprocessorsConfigured method should parse the className|priority|path format and check for empty class names, similar to how the main checkConfigurationChange method does at lines 65-72. Currently, this method returns true if the array length is greater than 0, even if all entries are empty or whitespace-only strings. This inconsistency could lead to incorrect detection of configuration changes when coprocessorHost is null.
The method should iterate through the coprocessor strings, parse each one using split("\\|"), extract the actual class name from token[0], trim it, and check if it's not null or empty before returning true.
| if (coprocessors != null && coprocessors.length > 0) { | |
| return true; | |
| if (coprocessors != null) { | |
| for (String coprocessor : coprocessors) { | |
| // Handle the className|priority|path format | |
| String[] tokens = coprocessor.split("\\|"); | |
| String actualClassName = tokens[0].trim(); | |
| if (!Strings.isNullOrEmpty(actualClassName)) { | |
| return true; | |
| } | |
| } |
|
@Jaehui-Lee is right, it's not working for existing regions, let's have the review against master branch #7514 and then we can come back on here. |
…rocessor enabled check to top
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
taklwu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those failures should be unrelated
https://issues.apache.org/jira/browse/HBASE-29526