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

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

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


##########
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java:
##########
@@ -3165,10 +3184,12 @@ private MetaDataMutationResult mutateColumn(
                 if (mutationResult.isPresent()) {
                     return mutationResult.get();
                 }
-
+                // We take a write row lock for tenantId, schemaName, 
tableOrViewName
                 acquireLock(region, key, locks);
+                // Invalidate the cache from all the regionservers.
+                invalidateServerMetadataCache(tenantId, schemaName, 
tableOrViewName);

Review Comment:
   > We need to call invalidate cache in other scenarios also like create 
index. 
   
   Yes, I have already created jira to update LAST_DDL_TIMESTAMP of the parent 
table/view when we add an index. 
[PHOENIX-7056](https://issues.apache.org/jira/browse/PHOENIX-7056)





> Create PhoenixRegionServerEndpoint#invalidateCache method to invalidate cache.
> ------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6968
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6968
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Rushabh Shah
>            Assignee: Rushabh Shah
>            Priority: Major
>
> Whenever we update metadata (like alter table add column, drop table), we 
> need to invalidate metadata cache entry (introduced by PHOENIX-6943) on all 
> the regionservers which has that cache entry. First step would be to issue an 
> invalidate command on all the regionservers irrespective of whether that 
> regionserver has the cache entry. We can further optimize by invalidating 
> only on RS that has that cache entry.
> In PHOENIX-6988 we created PhoenixRegionServerEndpoint implementing 
> RegionServerCoprocessor. We can create a new method in this co-proc something 
> like invalidateCache(CacheEntry) to invalidate cache for a given 
> table/view/index.



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

Reply via email to