Skip to content

Conversation

@Jaehui-Lee
Copy link
Contributor

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 0s Docker mode activated.
-1 ❌ docker 0m 2s Docker failed to build run-specific yetus/hbase:tp-18626}.
Subsystem Report/Notes
GITHUB PR #7543
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/1/console
versions git=2.17.1
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 38s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s 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 30s branch-2.6 passed
+1 💚 compile 2m 58s branch-2.6 passed
+1 💚 checkstyle 0m 37s branch-2.6 passed
+1 💚 spotbugs 1m 37s branch-2.6 passed
+1 💚 spotless 0m 49s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚 mvninstall 2m 56s the patch passed
+1 💚 compile 2m 59s the patch passed
+1 💚 javac 2m 59s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 39s the patch passed
+1 💚 spotbugs 1m 40s the patch passed
+1 💚 hadoopcheck 16m 29s Patch does not cause any errors with Hadoop 2.10.2 or 3.3.6 3.4.1.
+1 💚 spotless 0m 45s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 12s The patch does not generate ASF License warnings.
37m 53s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7543
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux e009dd0f82d5 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 79 (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/1/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 48s 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 3m 5s branch-2.6 passed
+1 💚 compile 0m 48s branch-2.6 passed
+1 💚 javadoc 0m 29s branch-2.6 passed
+1 💚 shadedjars 5m 41s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 2m 38s the patch passed
+1 💚 compile 0m 46s the patch passed
+1 💚 javac 0m 46s the patch passed
+1 💚 javadoc 0m 27s the patch passed
+1 💚 shadedjars 5m 42s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌ unit 213m 42s /patch-unit-hbase-server.txt hbase-server in the patch failed.
238m 47s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7543/1/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR #7543
Optional Tests javac javadoc unit compile shadedjars
uname Linux e3e4fd2c7524 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/1/testReport/
Max. process+thread count 3063 (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/1/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 0m 57s 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 11s branch-2.6 passed
+1 💚 compile 1m 20s branch-2.6 passed
+1 💚 javadoc 0m 37s branch-2.6 passed
+1 💚 shadedjars 7m 8s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 55s the patch passed
+1 💚 compile 1m 8s the patch passed
+1 💚 javac 1m 8s the patch passed
+1 💚 javadoc 0m 32s the patch passed
+1 💚 shadedjars 7m 21s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 240m 47s hbase-server in the patch passed.
273m 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/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7543
Optional Tests javac javadoc unit compile shadedjars
uname Linux c11503a1994e 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/1/testReport/
Max. process+thread count 3006 (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/1/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.

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