Skip to content

HBASE-29965: Unable to dynamically change readonly flag#7964

Open
kgeisz wants to merge 2 commits intoapache:HBASE-29081_rebasedfrom
kgeisz:HBASE-29965-cant-dynamically-change-read-only-flag
Open

HBASE-29965: Unable to dynamically change readonly flag#7964
kgeisz wants to merge 2 commits intoapache:HBASE-29081_rebasedfrom
kgeisz:HBASE-29965-cant-dynamically-change-read-only-flag

Conversation

@kgeisz
Copy link
Contributor

@kgeisz kgeisz commented Mar 21, 2026

https://issues.apache.org/jira/browse/HBASE-29965

Summary

This pull request fixes an issue where dynamic configuration for hbase.global.readonly.enabled was not working. If the user changed the boolean value for hbase.global.readonly.enabled in hbase-site.xml, saved the file, and then ran update_all_config, then the new config value was not being set in HBase. This was happening because the ConfigurationManager.notifyAllObservers() method was not getting the updated value for hbase.global.readonly.enabled. I was able to fix this by making sure CoprocessorConfigurationUtil.syncReadOnlyConfigurations() was not directly setting the conf value.

Key Changes

  • Adds a read-only instance variable to HMaster, HRegionServer, and HRegion.
    • This is used to track whether the read-only mode has been changed when update_all_config triggers the onConfigurationChange() method for each ConfigurationObserver.
  • Enabling/disabling read-only mode is now handled in the onConfigurationChange() method for HMaster, HRegionServer, and HRegion.
  • Updated CoprocessorConfigurationUtil.syncReadOnlyConfigurations() to have it only handle updating coprocessor lists. It no longer handles updating hbase.global.readonly.enabled in the configuration.
  • Updates when syncReadOnlyConfigurations() is run in the onConfigurationChange() methods. It is now run when the global read-only status has changed or when there has been a change in the coprocessor configuration.
  • Removes the read-only variable from the syncReadOnlyConfigurations() method signature.
    • syncReadOnlyConfigurations() is now either used when initializing a master, region server, or region, or when a configuration change has occurred. This means the method is always using the "most up-to-date" version of the configuration, so it can get the read-only mode from the configuration itself.

kgeisz added 2 commits March 20, 2026 17:01
Change-Id: I5b5479e37921ea233f586f0f02d2606320e16139
Change-Id: Ie9ba9c771b12793516a6227888caf9c734e05c86
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.

1 participant