palashc commented on code in PR #1859:
URL: https://github.com/apache/phoenix/pull/1859#discussion_r1563309487
##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/UpdateCacheAcrossDifferentClientsIT.java:
##########
@@ -104,17 +105,19 @@ public void testUpdateCacheFrequencyWithAddAndDropTable()
throws Exception {
} catch (TableNotFoundException e) {
//Expected
}
- rs = conn2.createStatement().executeQuery("select * from
"+tableName);
try {
+ rs = conn2.createStatement().executeQuery("select * from
"+tableName);
rs.next();
fail("Should throw
org.apache.hadoop.hbase.TableNotFoundException since the latest metadata " +
"wasn't fetched");
- } catch (PhoenixIOException ex) {
Review Comment:
@shahrs87 The difference comes from where the exception is thrown.
- The test has given UCF=1000000000 when creating the table. So when
client-2 from old design tried to query the dropped table, it does not refresh
its cache. `executeQuery` does not error out. `rs.next()` throws
`PhoenixIOException`
```
org.apache.phoenix.exception.PhoenixIOException:
org.apache.phoenix.exception.PhoenixIOException: N000001
at
org.apache.phoenix.util.ClientUtil.parseServerException(ClientUtil.java:70)
at
org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:1464)
at
org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:1398)
at
org.apache.phoenix.iterate.RoundRobinResultIterator.getIterators(RoundRobinResultIterator.java:188)
at
org.apache.phoenix.iterate.RoundRobinResultIterator.next(RoundRobinResultIterator.java:94)
at
org.apache.phoenix.jdbc.PhoenixResultSet.next(PhoenixResultSet.java:883)
```
- With new design, we fail in `executeQuery` itself and throw
`TableNotFoundException` when validating timestamps.
```
org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table
undefined.
at
org.apache.phoenix.exception.SQLExceptionCode$9.newException(SQLExceptionCode.java:239)
~[classes/:?]
at
org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:229)
~[classes/:?]
at
org.apache.phoenix.util.ClientUtil.parseRemoteException(ClientUtil.java:115)
~[classes/:?]
at
org.apache.phoenix.util.ClientUtil.parseServerExceptionOrNull(ClientUtil.java:80)
~[classes/:?]
at
org.apache.phoenix.util.ClientUtil.parseServerException(ClientUtil.java:66)
~[classes/:?]
at
org.apache.phoenix.util.ValidateLastDDLTimestampUtil.validateLastDDLTimestamp(ValidateLastDDLTimestampUtil.java:112)
~[classes/:?]
at
org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:390)
~[classes/:?]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]