-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29236: Add Support for Dynamic Configuration at the Coprocessor Level #6931
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
Merged
anmolnar
merged 20 commits into
apache:HBASE-29081
from
kgeisz:HBASE-29236-add-readonly-dynamic-config
May 29, 2025
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
97f2e55
HBASE-29083. Allow test to update hbase:meta table
anmolnar dc9342c
HBASE-29083. Spotless apply
anmolnar 8cb6784
Refactor code to have only passing tests
sharmaar12 3d3f5e1
Apply spotless
sharmaar12 77cc8fc
HBASE-29081: Make hbase.global.readonly.enabled dynamically configurable
kgeisz c5a9514
HBASE-29081: Run spotless apply
kgeisz 06f334a
HBASE-29081: Refactor to use globalReadOnlyEnabled instance variable
kgeisz 445891d
HBASE-29081: Register ReadOnlyController to for ConfigurationManager …
kgeisz 9c47401
HBASE-29081: Add hbase.global.readonly.enabled to configuration.adoc
kgeisz 0517f0b
HBASE-29081: Update warning message
kgeisz 0e91088
HBASE-29081: Only update hbase.global.readonly.enabled if its value h…
kgeisz 6a157ae
HBASE-29081: Add method documentation to registerConfigurationObserve…
kgeisz 7c58405
HBASE-29081: Add dynamic configuration for hbase.global.readonly.enab…
kgeisz fab41ca
HBASE-29081: Remove WALEdit checks from prePut() and preBatchMutate()
kgeisz 0bbfb83
HBASE-29081: Add unit test cases for the HBase Put command with hbase…
kgeisz 4c68b5b
HBASE-29081: Update comments
kgeisz c470095
Move static methods above test methods
kgeisz 035cfdb
Add comment
kgeisz fc41b3b
HBASE-29236: Skip internalReadOnlyGuard() check in prePut() and preBa…
kgeisz faf86e3
HBASE-29236: Add unit test for proving HBase can be started in Read-O…
kgeisz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
...rc/test/java/org/apache/hadoop/hbase/security/access/TestCanStartHBaseInReadOnlyMode.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.hadoop.hbase.security.access; | ||
|
|
||
| import static org.apache.hadoop.hbase.HConstants.HBASE_CLIENT_RETRIES_NUMBER; | ||
|
|
||
| import org.apache.hadoop.conf.Configuration; | ||
| import org.apache.hadoop.hbase.*; | ||
| import org.apache.hadoop.hbase.client.*; | ||
| import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; | ||
| import org.apache.hadoop.hbase.testclassification.LargeTests; | ||
| import org.apache.hadoop.hbase.testclassification.SecurityTests; | ||
| import org.junit.*; | ||
| import org.junit.experimental.categories.Category; | ||
| import org.junit.rules.TestName; | ||
|
|
||
| @Category({ SecurityTests.class, LargeTests.class }) | ||
| @SuppressWarnings("deprecation") | ||
| public class TestCanStartHBaseInReadOnlyMode { | ||
|
|
||
| @ClassRule | ||
| public static final HBaseClassTestRule CLASS_RULE = | ||
| HBaseClassTestRule.forClass(TestCanStartHBaseInReadOnlyMode.class); | ||
|
|
||
| private static final String READ_ONLY_CONTROLLER_NAME = ReadOnlyController.class.getName(); | ||
| private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); | ||
| private static Configuration conf; | ||
|
|
||
| @Rule | ||
| public TestName name = new TestName(); | ||
|
|
||
| @BeforeClass | ||
| public static void beforeClass() throws Exception { | ||
| conf = TEST_UTIL.getConfiguration(); | ||
|
|
||
| // Shorten the run time of failed unit tests by limiting retries and the session timeout | ||
| // threshold | ||
| conf.setInt(HBASE_CLIENT_RETRIES_NUMBER, 0); | ||
| conf.setInt("hbase.master.init.timeout.localHBaseCluster", 10000); | ||
|
|
||
| // Enable Read-Only mode to prove the cluster can be started in this state | ||
| conf.setBoolean(HConstants.HBASE_GLOBAL_READONLY_ENABLED_KEY, true); | ||
|
|
||
| // Add ReadOnlyController coprocessors to the master, region server, and regions | ||
| conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, READ_ONLY_CONTROLLER_NAME); | ||
| conf.set(CoprocessorHost.REGIONSERVER_COPROCESSOR_CONF_KEY, READ_ONLY_CONTROLLER_NAME); | ||
| conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, READ_ONLY_CONTROLLER_NAME); | ||
| } | ||
|
|
||
| @AfterClass | ||
| public static void afterClass() throws Exception { | ||
| TEST_UTIL.shutdownMiniCluster(); | ||
| } | ||
|
|
||
| @Test | ||
| public void testCanStartHBaseInReadOnlyMode() throws Exception { | ||
| TEST_UTIL.startMiniCluster(1); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.