Gabriel39 opened a new pull request, #71203: URL: https://github.com/apache/doris/pull/71203
### Background Doris optionally caches parsed Iceberg manifests per catalog. Iceberg V3 data files inherit row IDs from their manifest-list descriptor. A physical manifest can be reused by snapshots whose inherited first row IDs differ. ### What problem does this PR solve? Issue Number: None Related PR: #60937 (introduced the typed manifest cache), #61398 (introduced row-lineage reads) PR Type: Bugfix Problem Summary: With `meta.cache.iceberg.manifest.enable=true` (default false), warming a V2 manifest before upgrading to V3 can leave `_row_id` and `_last_updated_sequence_number` NULL after the first V3 append. Historical reads and branches can also borrow another descriptor's inherited IDs. Include the nullable inherited first row ID in cache identity so parsed files agree with the Iceberg SDK; most of the diff adds tests. ### Details - **Change map:** Production code +19/-5, tests +428/-0, generated output +75/-0; most changes are tests. The production change adds the inherited row-ID dimension and accounts for its retained boxed value in cache weight. - **Frequency:** Always when different row-ID descriptors reuse a warmed physical manifest. A property-only format upgrade does not assign IDs; the subsequent V3 commit does. - **Root cause:** `IcebergManifestEntryKey.of` used path and content alone, although parsed files retain descriptor-derived row IDs. The SDK baseline expects 5 for a reused manifest where the warmed cache returns NULL. - **Why existing tests missed it:** `IcebergExternalMetaCacheTest` covers cache loading and invalidation, but do not reuse an actual V2 manifest under new V3 descriptors. `test_iceberg_manifest_cache` covers refresh/reuse and the V3 lineage suites cover reads/DML, without preserving a warmed V2 parsed entry through this upgrade. The new external regression asserts cache hits and independently reads committed manifest-list descriptors to prove the trigger. - **Fix:** Keep NULL distinct from zero and from every assigned ID. Equivalent descriptors continue sharing cached files; table refresh still preserves reusable immutable manifests. Cache weight includes the additional retained Long. - **Other paths and branches:** Shared cache identity covers loading, prefetch and cache-only probes across formats/catalogs. Master and branch-4.2 receive companion fixes. Branch-4.1 has the same pattern and needs a separate backport; branch-3.1 and branch-4.0 lack the row-lineage consumer. No wire or storage format changes. ### Testing - `IcebergManifestRowLineageCacheTest`: all seven cases failed on the baseline and passed after the fix. Real in-memory Iceberg tables and SDK scans cover NULL/zero, upgrade, historical context, distinct branch IDs and equivalent-descriptor reuse. - 114 targeted FE tests passed locally, including all seven new cases, 104 cache cases and three native-prefetch cases. - The same Parquet/ORC SQL regression and generated golden file are included. Local manual checks used this branch's FE for cached/uncached scans and master FE for writes: upgrade, both batch modes, historical reads and post-UPDATE/MERGE lineage comparisons passed. The complete suite passed on master. ### Notes for Reviewers The standalone branch-4.2 SQL suite could not pass its initial INSERT against the available master BE: `External-file writes require a coordinator that acknowledges external-file reports`. A matching branch-4.2 BE is still needed to execute all writes through this branch. Native branch CI remains required. The regression uses the existing external Iceberg fixture and `external` / `external_docker` groups with `enableIcebergTest=true`. ### Release note Fix incorrect Iceberg V3 row lineage when the parsed-manifest cache reuses a manifest across format upgrades or snapshots with different inherited row IDs. ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Partially verified: standalone branch-4.2 SQL regression needs a matching BE; unit tests and candidate-FE scan comparisons passed ### AI Disclosure - Tool: Codex / GPT-6 - Generated: Code, tests and this description - Human review: not stated -- 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]
