Flink: Streaming from a missing branch can plan main's files and fail with a misleading error

Đang mở
#19,154 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@jiwen624 đang làm issue này rồi.

Từ ngày 29/11/2026.

Đá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
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend, data-engineering

Hướng nghiên cứu

The issue identifies IcebergSource and the automatic starting strategies, but does not name source files or tests. Start by tracing how the source initializes a streaming position and discovers snapshots for a branch, then inspect tests for the listed strategies. Done means the chosen missing-branch behavior is explicit and avoids misleading planning failures or skipped files; the issue leaves that behavior undecided.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Apache Iceberg version

None

Query engine

None

Please describe the bug 🐞

When IcebergSource streams from a branch that doesn't exist, the automatic starting strategies initialize the position from main, but later discovery looks up the branch and finds no snapshot. If the saved position is non-null, planning throws Invalid last enumerated position for an empty table: not null, which doesn't mention the branch, and the job fails once max-allowed-planning-failures (default 3) is exceeded.

  • TABLE_SCAN_THEN_INCREMENTAL: plans main's files, so rows from main may be emitted before the failure.
  • INCREMENTAL_FROM_LATEST_SNAPSHOT_EXCLUSIVE: fails whenever main has a current snapshot.
  • INCREMENTAL_FROM_LATEST_SNAPSHOT, INCREMENTAL_FROM_EARLIEST_SNAPSHOT: fail if the chosen start snapshot has a parent ID (e.g. main has 2+ snapshots, or older snapshots were expired). Otherwise they wait.

When the table has no current snapshot, these strategies wait and read the branch once it's created, so failing fast would change existing behavior. Simply treating a missing branch as empty doesn't work either: TABLE_SCAN_THEN_INCREMENTAL then skips its initial scan once the branch appears and misses still-live files from expired snapshots. Waiting would need the source to stay uninitialized until the branch exists.

Should a missing branch fail, or wait for the branch to be created? A clearer error naming the branch would help either way. Found while working on #19099, which keeps this behavior unchanged.

Willingness to contribute
  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time
Ngôn ngữ chính
Java
Star
9.5k
Fork
3.7k
Merge trung bình
2 ngày 2 giờ
Pull request đã merge (30 ngày)
170

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/iceberg

Tất cả issue của apache/iceberg

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.