Gabriel39 opened a new pull request, #71202: URL: https://github.com/apache/doris/pull/71202
### 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), #64304 (connector migration), #70869 (V4 cache provenance retained) 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 +9/-5, tests +392/-2, generated output +75/-0; most changes are tests. The production change supplies inherited row IDs to the existing key and updates its documentation. - **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:** `IcebergManifestCacheTest` and `IcebergManifestEntryKeyTest` cover cache reuse and key identity, 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. Existing V4 provenance dimensions remain intact. - **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. - 206 targeted connector tests passed locally, including all seven new cases and 133 V4 read cases. - `test_iceberg_manifest_row_lineage_cache`: generated and independently checked 12 result sections / 50 rows, then replayed successfully locally. Parquet and ORC cover property-only upgrade, reused manifests, both batch modes, historical reads, SDK equality, UPDATE and MERGE lineage preservation. ### Notes for Reviewers Local SQL verification used the candidate-built FE and a prebuilt ASAN BE at `dc02018bb2`, with execution protocol 19. No BE code changes are included. 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: Ready ### 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]
