Gabriel39 commented on code in PR #70216:
URL: https://github.com/apache/doris/pull/70216#discussion_r4488884417


##########
fe/be-java-extensions/fluss-scanner/src/main/java/org/apache/doris/fluss/FlussJniScanner.java:
##########
@@ -241,6 +247,44 @@ protected void openInternal() throws IOException {
         }
     }
 
+    /**
+     * The table, built from the info {@link FlussTableInfoCache} keeps for it 
rather than asked of the
+     * cluster by every range. A TTL of zero asks the way every range used to, 
metadata refresh included.
+     */
+    private Table openTable(Map<String, String> config) throws Exception {
+        TablePath tablePath = TablePath.of(required(DB_NAME), 
required(TABLE_NAME));
+        long ttlNanos = 
TimeUnit.SECONDS.toNanos(Long.parseLong(params.getOrDefault(
+                FlussTableInfoCache.TTL_PROPERTY, 
String.valueOf(FlussTableInfoCache.DEFAULT_TTL_SEC))));
+        if (ttlNanos <= 0) {
+            // Cache policy changes reuse, never which table may consume the 
planned bucket/offset range.
+            return validatePlannedIdentity(connection.getTable(tablePath));
+        }
+        Supplier<TableInfo> load = () -> 
connection.getAdmin().getTableInfo(tablePath).join();

Review Comment:
   Fixed in a2398935783. `openTable` now fetches live table metadata whenever 
either planned identity is absent, while still validating any identity that is 
supplied. Three embedded-cluster scanner scenarios cover table replacement with 
the table ID or both IDs omitted, and schema alteration with only the schema ID 
omitted. Each reproduces stale metadata with the preceding implementation and 
opens the current table/schema after the fix. All 103 scanner tests pass.



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