shahrs87 commented on code in PR #1666:
URL: https://github.com/apache/phoenix/pull/1666#discussion_r1340717545


##########
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixStatement.java:
##########
@@ -371,6 +482,23 @@ private PhoenixResultSet executeQuery(final 
CompilableStatement stmt,
                                 plan =
                                         
connection.getQueryServices().getOptimizer()
                                                 
.optimize(PhoenixStatement.this, plan);
+                                setLastQueryPlan(plan);
+
+                                //verify metadata for the table/view/index in 
the query plan
+                                if (plan.getTableRef() != null && 
validateLastDdlTimestamp) {
+                                    try {
+                                        
validateLastDDLTimestamp(plan.getTableRef(), true);
+                                    } catch (StaleMetadataCacheException e) {
+                                        String planSchemaName = 
plan.getTableRef().getTable().getSchemaName().toString();
+                                        String planTableName = 
plan.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);
+                                        // skip last ddl timestamp validation 
in the retry
+                                        return executeQuery(stmt, 
doRetryOnMetaNotFoundError, queryLogger, noCommit, false);

Review Comment:
   Isn't this still part of the outer try block and hence we will update the 
metrics twice? Cc @tkhurana 



-- 
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]

Reply via email to