Cached UC managed Delta table reads remain stale after RTAS or overwrite on Spark 4.0.1
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by reading Spark 4.0.1's DataSourceV2Strategy and the cached-plan invalidation path, then compare the qualified-name invalidation change in PR #52599. Reproduce the RTAS and saveAsTable overwrite cases with the supplied Spark, Delta, and UC versions, checking whether cache invalidation matches the cached V1 LogicalRelation. Done means fresh reads return replacement rows and the dependent cached view is refreshed, with the append control still fresh.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
We observed stale cached query results after successful replacement of a UC managed Delta table on Spark 4.0.1 with Delta 4.2.0 and OSS Unity Catalog 0.6.0. Both SQL REPLACE TABLE AS SELECT and DataFrameWriter.saveAsTable(mode="overwrite") are affected. The writes and reads occur in the same Spark session; this is not an external writer requiring explicit refresh.
Reproduction workflow
Precondition: a configured UC catalog supporting managed Delta tables, Java 17, and the matching Spark-line Delta/UC artifacts. Use independent tables for the two variants.
- Create a UC managed Delta table containing
(1, 'original'), withdelta.feature.catalogManaged=supported, deletion vectors disabled and CDF disabled. - Cache the qualified table name and materialize its rows. For the RTAS variant, also cache and materialize a dependent temporary view.
- Replace the table with
(2, 'replacement'), (3, 'replacement')through RTAS, or overwrite the independently seeded table with(3, 'overwritten')through saveAsTable. - Read the qualified table name through a newly created query, without REFRESH TABLE, CLEAR CACHE or manual uncache.
Expected: the new query returns the replacement rows; the dependent cached view also reflects the replacement.
Actual on Spark 4.0.1: Delta history advances to version 1, but the fresh query still returns (1, 'original'). The dependent view in the RTAS variant is stale too. No persisted-data loss has been observed.
Verification
| Spark | Delta | Execution | RTAS | saveAsTable overwrite | Append control |
|---|---|---|---|---|---|
| 4.0.1 | 4.2.0 | local[4] | Stale | Stale | Fresh |
| 4.0.1 | 4.2.0 | Standalone, separate driver/executor JVMs | Stale | Stale | Fresh |
| 4.1.1 | 4.2.0 | local[4] | Fresh | Fresh | Fresh |
The Spark-line comparison uses the corresponding Delta and UC artifacts, not byte-identical dependencies.
Diagnosis and question
The cached analyzed plan contains a V1 LogicalRelation. Spark 4.0.1's DataSourceV2Strategy constructs a synthetic DataSourceV2Relation for invalidation; it does not match the cached plan (sameResult == false, cache lookup empty). Both writes execute AtomicReplaceTableAsSelectExec. Repeating relation-based uncache after recording the stale read leaves the cache intact; qualified-name uncache clears it and the next read returns the committed replacement rows.
PR #52599, whose stated purpose is TimeTravelSpec support, also changes this strategy to qualified-name invalidation. We reference that code change as a possible explanation for the passing Spark 4.1.1 control, not as confirmation that this specific defect was reported or fixed there. We have not tested an isolated backport. Please confirm ownership of the V1/V2 invalidation mismatch and whether a focused correction for Spark 4.0.x is appropriate.
- Ngôn ngữ chính
- Scala
- Star
- 44.2k
- Fork
- 29.5k
- Merge trung bình
- 8 giờ 43 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/spark
-
[BUILD] Bump Ivy up to 2.6.0Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[SQL][CONNECT] SparkConnectClient may drop metadata (auth headers) on retried/reattached RPCs if metadata is a non-list iterableCó thể đã có người làm @zainmirzaaa đã nhận 62 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[CORE] bug report: collision of resource profile idCó thể đã có người làm @ybapat đã nhận 87 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
apache/spark#57498 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[BUILD] Drop oro dependencyĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/spark#57209 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
apache/spark#59659 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
scylladb/scylla-migrator#417 ·
-
arch build failsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
digital-asset/participant-query-store#177 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
containerbase/base#7891 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 91/100
com-vitthalmirji/toon4s#117 ·
Maintainer thường phản hồi trong vòng 1 ngày