[
https://issues.apache.org/jira/browse/PHOENIX-7113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17795912#comment-17795912
]
ASF GitHub Bot commented on PHOENIX-7113:
-----------------------------------------
shahrs87 commented on code in PR #1753:
URL: https://github.com/apache/phoenix/pull/1753#discussion_r1424498361
##########
phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java:
##########
@@ -650,16 +650,13 @@ public static Configuration
setUpConfigForMiniCluster(Configuration conf, ReadOn
}
/*
- Set property hbase.coprocessor.regionserver.classes to include
PhoenixRegionServerEndpoint
- by default. If some other regionserver coprocs are already present
then append
- PhoenixRegionServerEndpoint to the existing coprocs.
+ Set property hbase.coprocessor.regionserver.classes to include
PhoenixRegionServerEndpoint
+ by default, if some other regionserver coprocs are not already present.
*/
private static void setPhoenixRegionServerEndpoint(Configuration conf) {
String value = conf.get(REGIONSERVER_COPROCESSOR_CONF_KEY);
if (value == null) {
value = PhoenixRegionServerEndpoint.class.getName();
- } else {
Review Comment:
Earlier this was the check to decide whether we invalidate the cache on all
regionservers or not. In InvalidateMetadataCacheIT test, we override the
regionserver coproc to FailingPhoenixRegionServerEndpoint
[here](https://github.com/apache/phoenix/blob/PHOENIX-6883-feature/phoenix-core/src/it/java/org/apache/phoenix/end2end/InvalidateMetadataCacheIT.java#L51).
But we still add `PhoenixRegionServerEndpoint` to the conf property to pass
the below check. But now since the check is determined by a separate boolean
conf property, we can remove the unnecessary mess that I have created earlier.
```
String value = conf.get(REGIONSERVER_COPROCESSOR_CONF_KEY);
if (value == null
||
!value.contains(PhoenixRegionServerEndpoint.class.getName()))
```
> Create a feature flag for invoking MDEI#invalidateServerMetadataCache
> ---------------------------------------------------------------------
>
> Key: PHOENIX-7113
> URL: https://issues.apache.org/jira/browse/PHOENIX-7113
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Rushabh Shah
> Assignee: Rushabh Shah
> Priority: Major
>
> During schema changes, we invoke
> PhoenixRegionServerEndpoint#invalidateServerMetadataCache on all
> regionservers to invalidate cache for the table which is undergoing schema
> changes.
> To handle incompatibilitues during upgrade, we check if
> PhoenixRegionServerEndpoint coproc is loaded or not. If it is not loaded on
> SYSCAT regionserver, then we don't invalidate the cache but if it is loaded
> on SYSCAT regionserver then we call this coproc method on all regionservers.
> But it is possible that during upgrade if we upgrade the system regionservers
> first then PhoenixRegionServerEndpoint is loaded on SYSCAT RS but not loaded
> on other regionservers. This can cause failures during upgrade.
> To avoid this, lets create a new conf property and once all the reginservers
> are upgraded then set that to true.
> {code}
> String value = conf.get(REGIONSERVER_COPROCESSOR_CONF_KEY);
> if (value == null
> ||
> !value.contains(PhoenixRegionServerEndpoint.class.getName())) {
> // PhoenixRegionServerEndpoint is not loaded. We don't have to
> invalidate the cache.
> LOGGER.info("Skip invalidating server metadata cache since
> PhoenixRegionServerEndpoint"
> + " is not loaded");
> return;
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)