[
https://issues.apache.org/jira/browse/PHOENIX-3823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15998843#comment-15998843
]
Maddineni Sukumar commented on PHOENIX-3823:
--------------------------------------------
FYI - [~jamestaylor] / [~mujtabachohan]
Create VIEW command failing with actual table not found error and next retry
failed with VIEW already exists error..And its continuing like that(first
tabelnotfound and then view already exists)..
If I create table without UPDATE_CACHE_FREQUENCY then its working fine.
Create table command:
create table UpdateCacheViewTestB (k VARCHAR PRIMARY KEY, v1 VARCHAR, v2
VARCHAR) UPDATE_CACHE_FREQUENCY=100000;
Create View command:
CREATE VIEW my_view (v43 VARCHAR) AS SELECT * FROM UpdateCacheViewTestB WHERE
v1 = 'value1’;
sqlline Console output:
0: jdbc:phoenix:shared-mnds1-1-sfm.ops.sfdc.n> select * from
UPDATECACHEVIEWTESTB;
+------------------------------------------+------------------------------------------+------------------------------------------+
| K | V1
| V2 |
+------------------------------------------+------------------------------------------+------------------------------------------+
0: jdbc:phoenix:shared-mnds1-1-sfm.ops.sfdc.n> CREATE VIEW my_view (v43
VARCHAR) AS SELECT * FROM UpdateCacheViewTestB WHERE v1 = 'value1';
Error: ERROR 1012 (42M03): Table undefined. tableName=UPDATECACHEVIEWTESTB
(state=42M03,code=1012)
0: jdbc:phoenix:shared-mnds1-1-sfm.ops.sfdc.n> CREATE VIEW my_view (v43
VARCHAR) AS SELECT * FROM UpdateCacheViewTestB WHERE v1 = 'value1';
Error: ERROR 1013 (42M04): Table already exists. tableName=MY_VIEW
(state=42M04,code=1013)
0: jdbc:phoenix:shared-mnds1-1-sfm.ops.sfdc.n> CREATE VIEW my_view (v43
VARCHAR) AS SELECT * FROM UpdateCacheViewTestB WHERE v1 = 'value1';
Error: ERROR 1012 (42M03): Table undefined. tableName=UPDATECACHEVIEWTESTB
(state=42M03,code=1012)
> Force cache update on MetaDataEntityNotFoundException
> ------------------------------------------------------
>
> Key: PHOENIX-3823
> URL: https://issues.apache.org/jira/browse/PHOENIX-3823
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: James Taylor
> Assignee: Maddineni Sukumar
>
> When UPDATE_CACHE_FREQUENCY is used, clients will cache metadata for a period
> of time which may cause the schema being used to become stale. If another
> client adds a column or a new table or view, other clients won't see it. As a
> result, the client will get a MetaDataEntityNotFoundException. Instead of
> bubbling this up, we should retry after forcing a cache update on the tables
> involved in the query.
> The above works well for references to entities that don't yet exist.
> However, we cannot detect when some entities are referred to which no longer
> exists until the cache expires. An exception is if a physical table is
> dropped which would be detected immediately, however we would allow queries
> and updates to columns which have been dropped until the cache entry expires
> (which seems like a reasonable tradeoff IMHO. In addition, we won't start
> using indexes on tables until the cache expires.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)