apurtell commented on code in PR #2718:
URL: https://github.com/apache/phoenix/pull/2718#discussion_r4794476942


##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java:
##########
@@ -2981,7 +2981,16 @@ Collections.<byte[]> emptySet(), HConstants.NO_NONCE, 
HConstants.NO_NONCE,
           // used by buildTable does not include 't' due to how SCN is 
implemented.
           clientTimeStamp += 1;
         }
-        PTable newTable = buildTable(tableKey, cacheKey, region, 
clientTimeStamp, clientVersion);
+        // The catalog rows are already committed here. If the table read 
fails, for example
+        // because the region moves, do not report a failure. The client then 
builds the table
+        // from its own metadata.
+        PTable newTable = null;
+        try {
+          newTable = buildTable(tableKey, cacheKey, region, clientTimeStamp, 
clientVersion);
+        } catch (IOException | SQLException e) {
+          LOGGER.warn("Could not read {} {} after create, key {}; returning 
success without it",
+            tableType, fullTableName, Bytes.toStringBinary(tableKey), e);

Review Comment:
   Fixed in 0f18036885. When the read after the commit fails, the endpoint now 
builds the returned table from the catalog rows it has just committed for that 
table, the same way schema export does. Those rows include the server-generated 
DDL timestamp and external schema id, so a base table with change detection 
gets both values in the client cache and in its WAL annotations. The endpoint 
returns success without a table only if that in-memory build also fails, and 
for a base table that build does no catalog reads.
   
   (Claude Code)



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