github-actions[bot] commented on code in PR #69299:
URL: https://github.com/apache/doris/pull/69299#discussion_r4373901216
##########
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:
[P2] Keep warm snapshot pins aligned after raw-table eviction
With SQL caching disabled, a long table-cache TTL and
`meta.cache.iceberg.table.capacity=1`, read A cold and then warm at S1, read
cold B until its raw entry evicts A, append to A externally to create S2, and
read A twice. Cold B and the first subsequent A read now freeze a table and
take this branch without populating/replacing the separate latest-snapshot
cache, so its A=S1 entry survives. The first A read therefore returns S2, but
the next warm handle lookup returns only an identifier and the `else` branch
reuses S1; `buildScan` then applies that old snapshot and previously visible
rows disappear. Before this change, cold B also populated the latest cache and
displaced A's old pin. Resolve warm pins from the same retained raw-table
generation, or coordinate these cache generations while preserving old
in-flight readers. Please cover this cold/warm eviction sequence in the reuse
tests.
--
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]