Skip to content

Conversation

@sharmaar12
Copy link

No description provided.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@sharmaar12 sharmaar12 marked this pull request as ready for review December 17, 2025 08:12
@Apache-HBase

This comment has been minimized.

}

private boolean
isOperationOnNonMetaTable(final ObserverContext<? extends RegionCoprocessorEnvironment> c) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Simply call it "isOnMeta" and return the check c.getEnvironment().getRegionInfo().getTable().equals(TableName.META_TABLE_NAME), moving the negation check to the callers? eg:
...
if (!isOnMeta(c)) {
internalReadOnlyGuard();
}
...

Copy link
Author

Choose a reason for hiding this comment

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

Done.

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

will you change your PR based on wellington's comment ?

Map<TableName, RegionStatesCount> tableRegionStatesCountMap = new HashMap<>();
Map<String, TableDescriptor> tableDescriptorMap = getTableDescriptors().getAll();
for (TableDescriptor tableDescriptor : tableDescriptorMap.values()) {
List<TableDescriptor> tableDescriptors = listTableDescriptors(null, null, null, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] do we need to rebase it? I found kevin has this implementation already 00d9900

Copy link
Author

Choose a reason for hiding this comment

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

Yes will do this.

@sharmaar12
Copy link
Author

will you change your PR based on wellington's comment ?

@taklwu Yes will be doing that. So at the same time I will do rebase and resubmit.

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

There are some other system tables such as acl or namespace which are shared with
active cluster hence allowing operation with them in readonly cluster will
make system inconsistent.
This is done do avoid any conflicts after the changes in
HBASE-29691: Change TableName.META_TABLE_NAME from being a global static
return Optional.of(this);
}

@Override
Copy link
Author

Choose a reason for hiding this comment

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

Moved the preflush function below to put code for both versions together.

}

@Test(expected = IOException.class)
public void testPreBatchMutateReadOnlyException() throws IOException {
Copy link
Author

Choose a reason for hiding this comment

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

This test function is moved above to be added near the other tests covering same function.

@Test
public void testPreWALAppendReadOnlyMetaNoException() throws IOException {
readOnlyController.onConfigurationChange(readOnlyConf);
when(key.getTableName()).thenReturn(TableName.META_TABLE_NAME);
Copy link
Author

Choose a reason for hiding this comment

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

Note that here we will be using key to determine on which table the operation is getting performed on hence we have to mock key.getTableName instead of regionInfo.getTable()

Map<TableName, RegionStatesCount> tableRegionStatesCountMap = new HashMap<>();
Map<String, TableDescriptor> tableDescriptorMap = getTableDescriptors().getAll();
for (TableDescriptor tableDescriptor : tableDescriptorMap.values()) {
List<TableDescriptor> tableDescriptors = listTableDescriptors(null, null, null, true);
Copy link
Author

Choose a reason for hiding this comment

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

Yes will do this.

}

private boolean
isOperationOnNonMetaTable(final ObserverContext<? extends RegionCoprocessorEnvironment> c) {
Copy link
Author

Choose a reason for hiding this comment

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

Done.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 37s 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.
_ HBASE-29081 Compile Tests _
+1 💚 mvninstall 3m 32s HBASE-29081 passed
+1 💚 compile 3m 27s HBASE-29081 passed
-0 ⚠️ checkstyle 0m 15s /buildtool-branch-checkstyle-hbase-server.txt The patch fails to run checkstyle in hbase-server
+1 💚 spotbugs 1m 40s HBASE-29081 passed
+1 💚 spotless 0m 53s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 3s the patch passed
+1 💚 compile 3m 33s the patch passed
+1 💚 javac 3m 33s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 14s /buildtool-patch-checkstyle-hbase-server.txt The patch fails to run checkstyle in hbase-server
+1 💚 spotbugs 1m 42s the patch passed
+1 💚 hadoopcheck 12m 3s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 spotless 0m 46s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 12s The patch does not generate ASF License warnings.
39m 38s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7555/6/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7555
JIRA Issue HBASE-29779
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux 4d53d96975a8 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 HBASE-29081 / 2d548d1
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 83 (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-7555/6/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 42s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ HBASE-29081 Compile Tests _
+1 💚 mvninstall 4m 1s HBASE-29081 passed
+1 💚 compile 0m 59s HBASE-29081 passed
+1 💚 javadoc 0m 29s HBASE-29081 passed
+1 💚 shadedjars 6m 17s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 20s the patch passed
+1 💚 compile 1m 13s the patch passed
+1 💚 javac 1m 13s the patch passed
+1 💚 javadoc 0m 33s the patch passed
+1 💚 shadedjars 6m 17s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 231m 8s hbase-server in the patch passed.
260m 20s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7555/6/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7555
JIRA Issue HBASE-29779
Optional Tests javac javadoc unit compile shadedjars
uname Linux 281a41a039ba 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 HBASE-29081 / 2d548d1
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7555/6/testReport/
Max. process+thread count 4260 (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-7555/6/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.

LGTM

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.

4 participants