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


##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergConnectorMetadata.java:
##########
@@ -2623,11 +2730,21 @@ public Optional<ConnectorMvccSnapshot> 
beginQuerySnapshot(
         // per-user loadTable authorization) reads live per-user every call, 
so authorization runs every time (no
         // stale-authz window); mirrors resolveTableForRead's tableCache 
null-fallback. A disabled cache (the table
         // entry turned off) is a non-null cache that reads live internally.
-        IcebergLatestSnapshotCache.CachedSnapshot pin = latestSnapshotCache != 
null
-                ? latestSnapshotCache.getOrLoad(id, () -> 
loadLatestSnapshotPin(session, iceHandle))
-                : loadLatestSnapshotPin(session, iceHandle);
+        IcebergLatestSnapshotCache.CachedSnapshot pin;
+        if (IcebergStatementScope.hasReadTable(session, iceHandle.getDbName(), 
iceHandle.getTableName())) {
+            // Handle/schema resolution may have frozen an older generation 
before another query's REFRESH.
+            // A newer shared pin must not point outside that frozen metadata, 
nor may this reader publish its
+            // old pin over the refreshed cache entry.
+            pin = latestSnapshotPin(loadTable(session, iceHandle));

Review Comment:
   Fixed in 4cedfb0c5b8. The latest snapshot pin now comes from the same raw 
table cache generation whenever that cache exists; the independent 
latest-snapshot cache remains for catalogs without a raw table cache. Added a 
capacity-1 A/B eviction regression with an external append: the new test failed 
on the previous code (warm A returned S1 after cold A saw S2) and all 11 
IcebergTableHandleReuseTest cases pass after the fix. Existing in-flight 
readers still use their frozen statement table.



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