Skip to content

Conversation

@Jaehui-Lee
Copy link
Contributor

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

Copy link
Contributor

@taklwu taklwu left a comment

Choose a reason for hiding this comment

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

docker yetus failure has been reported, unit test failures are unrelated

Copy link

Copilot AI left a 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, which addresses an issue where dynamic configuration updates for coprocessors were not working correctly. The root cause was that the configuration change detection was comparing two configuration objects instead of comparing currently loaded coprocessors with the new configuration values.

Key Changes:

  • Modified CoprocessorConfigurationUtil.checkConfigurationChange() to compare currently loaded coprocessors with configuration values instead of comparing two configuration objects
  • Added getCoprocessorClassNames() method to CoprocessorHost to retrieve the full class names of loaded coprocessors
  • Updated test cases to modify the server's configuration object directly rather than using a separate configuration instance, which simulates the actual dynamic configuration reload behavior

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
CoprocessorConfigurationUtil.java Refactored configuration change detection to compare currently loaded coprocessors against new configuration values, added helper method for checking configured coprocessors
CoprocessorHost.java Added getCoprocessorClassNames() method to return full class names of loaded coprocessors for comparison
HRegionServer.java Updated to pass coprocessor host reference instead of old configuration to change detection method
HRegion.java Updated to pass coprocessor host reference instead of old configuration to change detection method
HMaster.java Updated to pass coprocessor host reference, removed redundant initializeCoprocessorHost() wrapper method
TestRegionServerOnlineConfigChange.java Modified tests to update configuration directly on server instances to properly simulate dynamic configuration reload

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

Comment on lines +96 to 104
private static boolean hasCoprocessorsConfigured(Configuration conf, String... configurationKey) {
for (String key : configurationKey) {
String oldValue = oldConfig.get(key);
String newValue = newConfig.get(key);
// check if the coprocessor key has any difference
if (!StringUtils.equalsIgnoreCase(oldValue, newValue)) {
isConfigurationChange = true;
break;
String[] coprocessors = conf.getStrings(key);
if (coprocessors != null && coprocessors.length > 0) {
return true;
}
}
return isConfigurationChange;
return false;
}
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The hasCoprocessorsConfigured method does not properly validate coprocessor entries. It returns true if the array is non-empty, but doesn't check if the entries contain actual coprocessor class names (they could be empty strings or whitespace). This could cause the method to return true even when no valid coprocessors are configured.

Consider checking if any of the entries actually contain non-empty class names after parsing, similar to how configuredClasses is built in checkConfigurationChange.

Copilot uses AI. Check for mistakes.
Comment on lines +38 to 105
/**
* Check configuration change by comparing current loaded coprocessors with configuration values.
* This method is useful when the configuration object has been updated but we need to determine
* if coprocessor configuration has actually changed compared to what's currently loaded.
* <p>
* <b>Note:</b> This method only detects changes in the set of coprocessor class names. It does
* <b>not</b> detect changes to priority or path for coprocessors that are already loaded with the
* same class name. If you need to update the priority or path of an existing coprocessor, you
* must restart the region/regionserver/master.
* @param coprocessorHost the coprocessor host to check current loaded coprocessors (can be null)
* @param conf the configuration to check
* @param configurationKey the configuration keys to check
* @return true if configuration has changed, false otherwise
*/
public static boolean checkConfigurationChange(CoprocessorHost<?, ?> coprocessorHost,
Configuration conf, String... configurationKey) {
Preconditions.checkArgument(configurationKey != null, "Configuration Key(s) must be provided");
boolean isConfigurationChange = false;
Preconditions.checkArgument(conf != null, "Configuration must be provided");

if (
!conf.getBoolean(CoprocessorHost.COPROCESSORS_ENABLED_CONF_KEY,
CoprocessorHost.DEFAULT_COPROCESSORS_ENABLED)
) {
return false;
}

if (coprocessorHost == null) {
// If no coprocessor host exists, check if any coprocessors are now configured
return hasCoprocessorsConfigured(conf, configurationKey);
}

// Get currently loaded coprocessor class names
Set<String> currentlyLoaded = coprocessorHost.getCoprocessorClassNames();

// Get coprocessor class names from configuration
// Only class names are compared; priority and path changes are not detected
Set<String> configuredClasses = new HashSet<>();
for (String key : configurationKey) {
String[] classes = conf.getStrings(key);
if (classes != null) {
for (String className : classes) {
// Handle the className|priority|path format
String[] classNameToken = className.split("\\|");
String actualClassName = classNameToken[0].trim();
if (!Strings.isNullOrEmpty(actualClassName)) {
configuredClasses.add(actualClassName);
}
}
}
}

// Compare the two sets
return !currentlyLoaded.equals(configuredClasses);
}

/**
* Helper method to check if there are any coprocessors configured.
*/
private static boolean hasCoprocessorsConfigured(Configuration conf, String... configurationKey) {
for (String key : configurationKey) {
String oldValue = oldConfig.get(key);
String newValue = newConfig.get(key);
// check if the coprocessor key has any difference
if (!StringUtils.equalsIgnoreCase(oldValue, newValue)) {
isConfigurationChange = true;
break;
String[] coprocessors = conf.getStrings(key);
if (coprocessors != null && coprocessors.length > 0) {
return true;
}
}
return isConfigurationChange;
return false;
}
}
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The significantly modified checkConfigurationChange method and the new hasCoprocessorsConfigured helper method lack direct unit test coverage. Given that this utility has comprehensive logic for comparing coprocessor configurations and handles edge cases like parsing className|priority|path format, these methods should have dedicated unit tests to verify correctness.

Consider adding a TestCoprocessorConfigurationUtil test class to cover:

  • Checking configuration changes when coprocessor host is null
  • Checking configuration changes with various coprocessor class name formats
  • Handling className|priority|path format parsing
  • Verifying the behavior when coprocessors are enabled/disabled
  • Testing the hasCoprocessorsConfigured helper with various inputs

Copilot uses AI. Check for mistakes.
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 44s 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.
_ branch-2.6 Compile Tests _
+1 💚 mvninstall 3m 41s branch-2.6 passed
+1 💚 compile 3m 9s branch-2.6 passed
+1 💚 checkstyle 0m 40s branch-2.6 passed
+1 💚 spotbugs 1m 42s branch-2.6 passed
+1 💚 spotless 0m 52s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 12s the patch passed
+1 💚 compile 3m 4s the patch passed
+1 💚 javac 3m 4s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 39s the patch passed
+1 💚 spotbugs 1m 46s the patch passed
+1 💚 hadoopcheck 17m 48s Patch does not cause any errors with Hadoop 2.10.2 or 3.3.6 3.4.1.
+1 💚 spotless 0m 46s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 11s The patch does not generate ASF License warnings.
40m 7s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7543
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux 1054196924f6 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 branch-2.6 / 8de1800
Default Java Eclipse Adoptium-11.0.23+9
Max. process+thread count 81 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/2/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 59s Docker mode activated.
-0 ⚠️ yetus 0m 6s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2.6 Compile Tests _
+1 💚 mvninstall 4m 44s branch-2.6 passed
+1 💚 compile 1m 14s branch-2.6 passed
+1 💚 javadoc 0m 33s branch-2.6 passed
+1 💚 shadedjars 7m 38s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 54s the patch passed
+1 💚 compile 0m 58s the patch passed
+1 💚 javac 0m 58s the patch passed
+1 💚 javadoc 0m 28s the patch passed
+1 💚 shadedjars 7m 17s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 211m 7s hbase-server in the patch passed.
243m 12s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #7543
Optional Tests javac javadoc unit compile shadedjars
uname Linux 56bc1f0c2a63 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 branch-2.6 / 8de1800
Default Java Eclipse Adoptium-11.0.23+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/2/testReport/
Max. process+thread count 3344 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/2/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.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 25s Docker mode activated.
-0 ⚠️ yetus 0m 6s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2.6 Compile Tests _
+1 💚 mvninstall 4m 33s branch-2.6 passed
+1 💚 compile 1m 19s branch-2.6 passed
+1 💚 javadoc 0m 40s branch-2.6 passed
+1 💚 shadedjars 7m 22s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 4m 8s the patch passed
+1 💚 compile 1m 8s the patch passed
+1 💚 javac 1m 8s the patch passed
+1 💚 javadoc 0m 35s the patch passed
+1 💚 shadedjars 7m 46s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌ unit 275m 30s /patch-unit-hbase-server.txt hbase-server in the patch failed.
310m 21s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7543
Optional Tests javac javadoc unit compile shadedjars
uname Linux 8df361b3b250 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 branch-2.6 / 8de1800
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/2/testReport/
Max. process+thread count 3312 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/2/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.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 20s Docker mode activated.
-0 ⚠️ yetus 0m 6s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2.6 Compile Tests _
+1 💚 mvninstall 4m 30s branch-2.6 passed
+1 💚 compile 1m 3s branch-2.6 passed
+1 💚 javadoc 0m 36s branch-2.6 passed
+1 💚 shadedjars 6m 22s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 27s the patch passed
+1 💚 compile 1m 3s the patch passed
+1 💚 javac 1m 3s the patch passed
+1 💚 javadoc 0m 33s the patch passed
+1 💚 shadedjars 6m 13s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 292m 49s hbase-server in the patch passed.
323m 27s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/2/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR #7543
Optional Tests javac javadoc unit compile shadedjars
uname Linux c5a3e6b9c150 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 branch-2.6 / 8de1800
Default Java Temurin-1.8.0_412-b08
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/2/testReport/
Max. process+thread count 2869 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/2/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.

@taklwu
Copy link
Contributor

taklwu commented Dec 22, 2025

TestProcDispatcher.testRetryLimitOnConnClosedErrors timeout , so it's unrelated, merging

@taklwu taklwu merged commit ab7ca7d into apache:branch-2.6 Dec 22, 2025
6 of 7 checks passed
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