github-actions[bot] commented on code in PR #69806:
URL: https://github.com/apache/doris/pull/69806#discussion_r4410009550


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/plugin/PluginDrivenExternalTable.java:
##########
@@ -890,11 +958,12 @@ public Optional<String> getShowCreateTableDdl() {
         }
         ConnectorSession session = pluginCatalog.buildConnectorSession();
         ConnectorMetadata metadata = PluginDrivenMetadata.get(session, 
connector);
+        MetadataRead read = observeConnectorMetadata(session, metadata);
         Optional<ConnectorTableHandle> handleOpt = 
resolveConnectorTableHandle(session, metadata);
         if (!handleOpt.isPresent()) {
             return Optional.empty();
         }
-        return metadata.renderShowCreateTableDdl(session, handleOpt.get());
+        return read.execute(() -> metadata.renderShowCreateTableDdl(session, 
handleOpt.get()));

Review Comment:
   [P2] Fence observations until a metadata refresh has completed
   
   The new guarded SHOW CREATE path can evict refreshed state when it starts 
during a metadata-only refresh. `RefreshManager.refreshTableInternal` 
increments `metadataRefreshGeneration` before invalidating connector/engine 
caches, releasing the catalog monitor after just the increment. Pause there: 
SHOW CREATE captures the new generation, resolves a hot Hive handle, and 
`getTableFresh` records a dropped table but delays its failure. Recreate that 
table, finish the refresh, and warm its new schema on the same FE object before 
releasing the failure. Names/object observations and the captured generation 
still match, and `viewExists` is false for the recreated base table, so this 
cleanup removes its refreshed caches and ID route; `getTableNullable(id)` then 
returns null until a by-name lookup republishes it. Fence capture across the 
full refresh interval, including completion, and cover this interleaving. 
Existing tests start the failed read before the generation increment. This 
differs 
 from the existing missing-wrapper and comment-TTL threads.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to