JingsongLi commented on code in PR #8423:
URL: https://github.com/apache/paimon/pull/8423#discussion_r3523308326


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/lookup/FullCacheLookupTable.java:
##########
@@ -233,7 +235,19 @@ public void refresh() throws Exception {
             return;
         }
 
-        Long latestSnapshotId = table.snapshotManager().latestSnapshotId();
+        // For chain tables, the outer table and delta branch use different 
snapshot sequences,
+        // so we must use the delta branch's snapshot manager for backlog 
calculation.
+        boolean isChainTable =
+                table instanceof FallbackReadFileStoreTable

Review Comment:
   This still does not hit the chain-table path in full-cache refresh. 
`this.table` is assigned from `context.table`, and `Context` wraps the original 
table with `LookupFileStoreTable.create(...)`, so the object here is a 
`LookupFileStoreTable`, not a `FallbackReadFileStoreTable`. As a result 
`isChainTable` is always false and async refresh still compares 
`reader.nextSnapshotId()` from the delta-branch `ChainTableStreamScan` with the 
outer/lookup table snapshot manager. Please unwrap 
`LookupFileStoreTable.wrapped()` (or keep the original table in the context) 
before checking for `FallbackReadFileStoreTable`, and add a refresh test that 
fails if this branch is not taken.



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