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

Lars Hofhansl edited comment on PHOENIX-5584 at 11/23/19 11:55 PM:
-------------------------------------------------------------------

[~tdsilva] thanks for looking. It all works fine when 
{{phoenix.allow.system.catalog.rollback}} is set to true.

But I believe it's more by accident :)

In the debugger I see in MetaDataEndpointImpl.getTable(...) that with rollback 
false it returns only the view's columns to the client. With rollback set to 
true it returns all columns (table and view). I think that is also wrong. The 
rollback feature is about being able to rollback an upgrade, not about 
returning the right data to an old client.

I think what should happen is that for an old client client the metadata 
endpoint gathers all the metadata (table and view) and returns the complete set 
of the client. I.e. do the equivalent of the new 
MetaDataClient.addColumnsAndIndexesFromAncestors on the server again. Perhaps 
it's just receiving the parent table then calling {{public static 
ViewUtil.addDerivedColumnsAndIndexesFromParent(connection, table, parentTable)}}

For a new client metadata endpoint should always return metadata in the new 
format to the client.

I know it was me who suggested that we have to do these on the client and that 
is still true, otherwise we'd hammer the system with server-to-server RPC 
making it worse than the previous single region SYSCAT. On the other hand, it 
still has to work. :(

[~ckulkarni] I agree.


was (Author: lhofhansl):
[~tdsilva] thanks for looking. It all works fine when 
{{phoenix.allow.system.catalog.rollback}} is set to true.

But I believe it's more by accident :)

In the debugger I see in MetaDataEndpointImpl.getTable(...) that with rollback 
false it returns only the view's columns to the client. With rollback set to 
true it returns all columns (table and view). I think that is also wrong. The 
rollback feature is about being able to rollback an upgrade, not about 
returning the right data to an old client.

I think what should happen is that for an old client client the metadata 
endpoint gathers all the metadata (table and view) and returns the complete set 
of the client. I.e. do the equivalent of the new 
MetaDataClient.addColumnsAndIndexesFromAncestors on the server again.

For a new client metadata endpoint should always return metadata in the new 
format to the client.

I know it was me who suggested that we have to do these on the client and that 
is still true, otherwise we'd hammer the system with server-to-server RPC 
making it worse than the previous single region SYSCAT. On the other hand, it 
still has to work. :(

[~ckulkarni] I agree.

> old client can't get right view metadata when 4.15 client created view
> ----------------------------------------------------------------------
>
>                 Key: PHOENIX-5584
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5584
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.15.0, 5.1.0
>            Reporter: Xinyi Yan
>            Assignee: Chinmay Kulkarni
>            Priority: Blocker
>             Fix For: 4.15.0, 5.1.0
>
>
> To reproduce this bug locally:
>  1. start the sandbox at 4.15.
>  2. created table and view at 4.15 client.
> {code:java}
> CREATE TABLE AAA (A BIGINT PRIMARY KEY, B BIGINT);
> CREATE VIEW A_VIEW AS SELECT * FROM AAA;
> {code}
> 3. query `SELECT * FROM A_VIEW` at 4.14 client.
> {code:java}
> 0: jdbc:phoenix:localhost:51070> SELECT * FROM A_VIEW;
> +--+
> |  |
> +--+
> +--+
> No rows selected (0.009 seconds)
> {code}



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

Reply via email to