924060929 commented on code in PR #69632:
URL: https://github.com/apache/doris/pull/69632#discussion_r4384932344


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalTable.java:
##########
@@ -403,12 +405,17 @@ public boolean isPartitionColumnAllowNull() {
 
     @Override
     public MvccSnapshot loadSnapshot(Optional<TableSnapshot> tableSnapshot, 
Optional<TableScanParams> scanParams) {
-        return new 
PaimonMvccSnapshot(getPaimonSnapshotCacheValue(tableSnapshot, scanParams));
+        return withMissingTableRepair(() -> {

Review Comment:
   Fixed in c5a3b97f2569. Paimon now classifies its SDK TableNotExistException 
by identifier: only the matching remote DB/table on main, excluding system 
tables, authorizes base cleanup. A branch mismatch is terminal even with nested 
HMS UnknownTableException. testDroppedBranchDoesNotRetireBaseOrSibling 
simulates a drop after branchExists() and verifies both base and sibling 
numeric routes remain; both implicit and explicit main misses still repair.
   
   Validation: 226 selected FE tests passed (the embedded-FE RefreshTableTest 
port collision was cleared by a targeted retry); build.sh --fe with UI disabled 
and Checkstyle passed. SDK absence cases are deterministic unit tests, not a 
live-service integration claim.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalTable.java:
##########
@@ -479,15 +488,21 @@ public boolean supportsLatestSnapshotPreload() {
 
     @Override
     public List<Column> getFullSchema() {
-        // Descriptor serialization is table-only and may follow multiple 
OPTIONS aliases. Keep it
-        // on a validated statement projection rather than falling back to the 
neutral cache.
-        return getPaimonSchemaCacheValue(
-                
MvccUtil.getSnapshotForTableMetadataFromContext(this)).getSchema();
+        return withMissingTableRepair(() -> {

Review Comment:
   Fixed in c5a3b97f2569. Guarded the common unlocked getBasePaimonTable() load 
rather than adding another accessor-only wrapper. 
testStatusCommentMissingBaseTableRepairsLookup covers a status-first 
getComment() miss and verifies retained-observation repair for implicit and 
explicit main identifiers.
   
   Validation: 226 selected FE tests passed (the embedded-FE RefreshTableTest 
port collision was cleared by a targeted retry); build.sh --fe with UI disabled 
and Checkstyle passed. SDK absence cases are deterministic unit tests, not a 
live-service integration claim.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalTable.java:
##########
@@ -393,6 +394,31 @@ public Optional<ColumnStatistic> getColumnStatistic(String 
colName) {
         return Optional.empty();
     }
 
+    /** Only table-level remote reads use this seam; partition misses and 
arbitrary failures do not repair names. */
+    protected <R> R withMissingTableRepair(Supplier<R> read) {
+        // Metadata validators can enter a schema read under this monitor. 
Repair only after
+        // an outer unlocked entry point has unwound it, preserving catalog -> 
table lock order.
+        if (Thread.holdsLock(this)) {
+            return read.get();
+        }
+        Optional<Runnable> observation = db.observeTableLookup(this);
+        try {
+            return read.get();
+        } catch (RuntimeException failure) {
+            Throwable cause = failure;
+            while (cause != null) {
+                if (cause instanceof 
org.apache.hadoop.hive.metastore.api.NoSuchObjectException
+                        || cause instanceof 
org.apache.iceberg.exceptions.NoSuchTableException

Review Comment:
   Fixed in c5a3b97f2569. The shared classifier now recognizes HMS 
UnknownTableException without a NoSuchObjectException cause and Iceberg 
NoSuchViewException. missingHmsSchemaRepairsLookupWithoutNoSuchObjectCause and 
testStatusCommentMissingViewRepairsLookup cover both. Paimon overrides 
classification with its own identifier semantics so a branch miss cannot become 
a base miss via an HMS cause.
   
   Validation: 226 selected FE tests passed (the embedded-FE RefreshTableTest 
port collision was cleared by a targeted retry); build.sh --fe with UI disabled 
and Checkstyle passed. SDK absence cases are deterministic unit tests, not a 
live-service integration claim.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergExternalTable.java:
##########
@@ -276,12 +281,18 @@ protected boolean needInternalHiddenColumns() {
 
     @Override
     public List<Column> getFullSchema() {
-        return getFullSchema(MvccUtil.getSnapshotFromContext(this));
+        return withMissingTableRepair(() -> {
+            return getFullSchema(MvccUtil.getSnapshotFromContext(this));
+
+        });
     }
 
     @Override
     public List<Column> getFullSchema(Optional<MvccSnapshot> snapshot) {
-        return IcebergUtils.withSnapshotCacheValue(snapshot, this, 
this::projectFullSchema);
+        return withMissingTableRepair(() -> {

Review Comment:
   Fixed in c5a3b97f2569. Wrapped the common native system-table schema load in 
sourceTable.withMissingTableRepair(), so all synthetic schema entry points 
capture the real source identity before SDK work. 
testSystemSchemaMissingSourceRepairsSourceLookup verifies repair observes the 
source and never the synthetic object. The SDK call unwinds before guarded 
cleanup runs.
   
   Validation: 226 selected FE tests passed (the embedded-FE RefreshTableTest 
port collision was cleared by a targeted retry); build.sh --fe with UI disabled 
and Checkstyle passed. SDK absence cases are deterministic unit tests, not a 
live-service integration claim.



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