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

Thomas D'Silva commented on PHOENIX-4475:
-----------------------------------------

When we run a query we make an rpc to fetch the latest metadata of a table if 
the table is not present in the cache and the last resolved time is less than 
{{UPDATE_CACHE_FREQUENCY}}.
The behavior of {{PhoenixRuntime.getTable}} is different in that it *always* 
looks in the cache and if the table is present it never fetches the latest 
metadata from the server. This could be problematic if another client changed 
the metadata of the table after it was cached. 
I think we should change {{PhoenixRuntime.getTable}}  to be consistent with 
what happens when we run a query. 

> Change PhoenixRuntime.getTable to fetch the latest metadata of the table 
> being looked up
> ----------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-4475
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4475
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Thomas D'Silva
>            Priority: Major
>
> Returns the table if it is found in the connection metadata cache. If the 
> metadata of this
> table has changed since it was put in the cache these changes will not 
> necessarily be
> reflected in the returned table. If the table is not found, makes a call to 
> the server to
> fetch the latest metadata of the table. 
> This is different than how a table is resolved when it is referenced from a 
> query (a call is made to the server to fetch the latest metadata of the table 
> depending on the UPDATE_CACHE_FREQUENCY property)
> We could change PhoenixRuntime.getTable to make this behavior the same at the 
> cost of an extra RPC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to