[
https://issues.apache.org/jira/browse/PHOENIX-7025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17771281#comment-17771281
]
ASF GitHub Bot commented on PHOENIX-7025:
-----------------------------------------
shahrs87 commented on code in PR #1666:
URL: https://github.com/apache/phoenix/pull/1666#discussion_r1343211296
##########
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixStatement.java:
##########
@@ -417,54 +538,66 @@ private PhoenixResultSet executeQuery(final
CompilableStatement stmt,
e.getSchemaName(),
e.getTableName(), true)
.wasUpdated()) {
//TODO we can log retry count and
error for debugging in LOG table
- return executeQuery(stmt, false,
queryLogger, noCommit);
+ return executeQuery(stmt, false,
queryLogger, noCommit, validateLastDdlTimestamp);
}
}
throw e;
- } catch (RuntimeException e) {
-
+ }
+ catch (StaleMetadataCacheException e) {
+ updateMetrics = false;
+ String planSchemaName =
lastQueryPlan.getTableRef().getTable().getSchemaName().toString();
+ String planTableName =
lastQueryPlan.getTableRef().getTable().getTableName().toString();
+ // force update client metadata cache
+ LOGGER.debug("Force updating client metadata
cache for {}", getInfoString(getLastQueryPlan().getTableRef()));
+ new
MetaDataClient(connection).updateCache(connection.getTenantId(),
planSchemaName, planTableName, true);
Review Comment:
Add a comment saying that this will update the cache for all the parents in
the hieracrchy.
> Create a new RPC to validate last ddl timestamp for read requests.
> ------------------------------------------------------------------
>
> Key: PHOENIX-7025
> URL: https://issues.apache.org/jira/browse/PHOENIX-7025
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Rushabh Shah
> Assignee: Palash Chauhan
> Priority: Major
>
> Introduce a new RPC request from phoenix client to any region server via
> PhoenixRegionServerEndpoint#validateLastDDLTimestamp. Since the last ddl
> timestamp cache is maintained by all the regionservers, you can choose any
> regionserver randomly. In future, we can make this rpc more resilient by
> sending this rpc to multiple regionservers simultaneously.
> If phoenix client throws StaleMetadataCacheException then invalidate the
> cache on the client side and retry executeQuery method while fetching the
> updated metadata from SYSCAT regionserver.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)