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

Samarth Jain commented on PHOENIX-2852:
---------------------------------------

+1, looks good [~tdsilva]. One thing worth testing is that we are able to 
successfully construct the URL on the server side. I would test this outside of 
our test setup since we are running things on the same JVM there. You could 
trigger one of the flows that needs Phoenix connection on the server side. For 
ex - dropping a column that we have a view index on.

> Dropping columns could trigger upgrade code on server side
> ----------------------------------------------------------
>
>                 Key: PHOENIX-2852
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2852
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Samarth Jain
>            Assignee: Thomas D'Silva
>         Attachments: PHOENIX-2852.patch
>
>
> In MetadataEndPointImpl.java, I noticed that we are obtaining a Phoenix 
> connection by going through the Phoenix driver. This could be dangerous as it 
> could end up triggering the upgrade code. 
> {code}
> // check if the view where expression contains the column being dropped and 
> prevent
>                 // it
>                 if (existingViewColumn != null && view.getViewStatement() != 
> null) {
>                     ParseNode viewWhere =
>                             new 
> SQLParser(view.getViewStatement()).parseQuery().getWhere();
>                     PhoenixConnection conn=null;
>                     try {
>                         conn = 
> QueryUtil.getConnection(env.getConfiguration()).unwrap(
>                             PhoenixConnection.class);
>                     } catch (ClassNotFoundException e) {
>                     }
> {code}
> [~jamestaylor] has added a nice way of getting a phoenix connection without 
> running the upgrade by doing something like this:
> {code}
> final Properties props = new Properties();
>                       props.setProperty(PhoenixRuntime.NO_UPGRADE_ATTRIB, 
> Boolean.TRUE.toString());
>                         conn = DriverManager.getConnection(getJdbcUrl(env), 
> props).unwrap(PhoenixConnection.class);
> {code}
> [~tdsilva] - would you mind taking a look? Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to