-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29779: Call super coprocessor instead of returning for system table #7555
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
base: HBASE-29081
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bba9be4 to
a0c20a2
Compare
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| private boolean | ||
| isOperationOnNonMetaTable(final ObserverContext<? extends RegionCoprocessorEnvironment> c) { |
There was a problem hiding this comment.
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();
}
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
e08c367 to
00d9900
Compare
taklwu
left a comment
There was a problem hiding this 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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes will do this.
@taklwu Yes will be doing that. So at the same time I will do rebase and resubmit. |
2431036 to
2a49b5b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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
eb864ab to
2d548d1
Compare
| return Optional.of(this); | ||
| } | ||
|
|
||
| @Override |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
taklwu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.