[ 
https://issues.apache.org/jira/browse/PHOENIX-7115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17795115#comment-17795115
 ] 

ASF GitHub Bot commented on PHOENIX-7115:
-----------------------------------------

shahrs87 commented on code in PR #1748:
URL: https://github.com/apache/phoenix/pull/1748#discussion_r1421813746


##########
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -555,6 +560,24 @@ private void openConnection() throws SQLException {
         }
     }
 
+    /*
+    We create a long-lived hbase connection to run invalidate cache RPCs. We 
override
+    CUSTOM_CONTROLLER_CONF_KEY to instantiate 
InvalidateMetadataCacheController which has
+    a special priority for invalidate metadata cache operations.
+ */
+    public Connection getInvalidateMetadataCacheConnection() throws 
IOException {
+        if (invalidateMetadataCacheConnection != null) {
+            return invalidateMetadataCacheConnection;
+        }
+        // TODO Do we need a double locking here?
+        Configuration clonedConfiguration = 
PropertiesUtil.cloneConfig(this.config);
+        clonedConfiguration.setClass(CUSTOM_CONTROLLER_CONF_KEY,
+                InvalidateMetadataCacheControllerFactory.class, 
RpcControllerFactory.class);
+        invalidateMetadataCacheConnection = 
ConnectionFactory.createConnection(clonedConfiguration);

Review Comment:
   Refactored openConnection and closeConnection methods 
[here](https://github.com/apache/phoenix/pull/1748/commits/4a2138f8124fc1d09a66bd1e6f43f55c518595de).





> Create separate handler thread pool for invalidating server metadata cache
> --------------------------------------------------------------------------
>
>                 Key: PHOENIX-7115
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7115
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Rushabh Shah
>            Assignee: Rushabh Shah
>            Priority: Major
>
> MutableIndexFailureIT#testIndexWriteFailure is failing. See 
> [this|https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1726/9/#showFailuresLink]
>  build for reference.
> Currently all the invalidateServerMetadataCache invocations are handled by 
> default RPC handler threads. We have 5 default handler threads configured in 
> tests. 
> This test makes sure that write to index table fails and since 
> disableIndexOnWriteFailure is set to true, it will disable the index. We use 
> around 10 different threads on the client side to write to base table and  
> index table, so we use all the 5 handler threads to serve writes.
> Since writes to index fails, within the handler threads it will try to update 
> the index state to  DISABLE. 
> On receiving the updateIndexState rpc, MetadataEndpointImpl will try to 
> invalidate the server metadata cache on all the regionservers. The 
> regionserver hosting index table doesn't have any available handler threads 
> to serve invalidateServerMetadataCache requests. Hence the test fails.
> The root cause is all the read/write operations and invalidate server 
> metadata cache operations share the same RPC handler pool. We need to have 
> separate thread pool for 
> invalidate server metadata cache operations



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to