Spark: Async micro-batch preload does not stop when either limit is reached
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #17950 @iamrajatrana による — マージされずにクローズ
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 90/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java, spark
調査の方向性
AsyncSparkMicroBatchPlanner.fillQueueInitialBuffer から始め、初期プリロード条件を同じクラスのバックグラウンド補充パスと比較します。両方の非対称な行数/ファイル数制限状態について、対象を絞った Spark 4.1 のリグレッションテストを実行または拡張し、その後、対応する修正を 3 つの Spark バージョンすべてに適用して、テストが成功することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Spark: Async micro-batch preload does not stop when either limit is reached
Apache Iceberg version
main (0107f19a4a); present in Spark 3.5, 4.0, and 4.1.
Query engine
Spark Structured Streaming with async-micro-batch-planning-enabled=true.
Description
AsyncSparkMicroBatchPlanner.fillQueueInitialBuffer combines the initial row and file limits with
||:
while ((queuedRowCount.get() < targetRows || queuedFileCount.get() < targetFiles)
&& current.snapshotId() != preloadEndSnapshot.snapshotId()) {
This continues preloading until both limits are reached. It should stop when either limit is reached,
which requires && between the two below-limit checks.
This is also consistent with the background-refill path in the same class, which considers the
buffer full when either its row or file threshold is exceeded.
The default initial limits are 100 files and 100,000 rows. For example, if each pending snapshot adds
100 one-row files, the file limit is reached after the first snapshot, but current code can continue
through 1,000 snapshots and retain 100,000 file tasks before reaching the row limit. The inverse
happens when snapshots contain a small number of files with many rows.
This affects startup and catch-up with a snapshot backlog, such as after downtime, restart from an
old checkpoint, or AvailableNow processing. Extra preload causes unnecessary manifest planning,
driver allocations, startup latency, and possible memory pressure. It does not cause data loss.
Proposed fix
Use && in all three Spark versions:
while ((queuedRowCount.get() < targetRows && queuedFileCount.get() < targetFiles)
&& current.snapshotId() != preloadEndSnapshot.snapshotId()) {
Add regression coverage for both asymmetric states:
// File limit reached, row limit not reached
assertThat(shouldContinueInitialPreload(1L, 100L, 100_000L, 100L)).isFalse();
// Row limit reached, file limit not reached
assertThat(shouldContinueInitialPreload(100_000L, 1L, 100_000L, 100L)).isFalse();
A focused Spark 4.1 test failed with the current || condition and passed after changing it to
&&.
Snapshots are added atomically, so preload may still exceed a limit by one snapshot. Strict
within-snapshot enforcement is outside this fix.
Willingness to contribute
- I can contribute a fix independently
- I would be willing to contribute a fix with guidance
- I cannot contribute a fix at this time
- 主要言語
- Java
- スター
- 9.4k
- フォーク
- 3.7k
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 160
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/iceberg のほかの issue
-
Spark: Test INSERT targets with computed IDENTIFIER expressions対応中かも @shivadarshan-devadiga が 7 日前に担当しました。 オープンimprovement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
[Core] TestAvroPartitionStatsHandler fails on Windows due to unclosed partition statistics scan対応中かも @Ankitkj1999 が 9 日前に担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Flink: JdbcLockFactory concurrent lock-table creation can fail with "table already exists" and restart the job対応中かも @adiranjan25 が 16 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/iceberg#18797 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Core: TableMetadata.Builder allows adding encryption keys to v1/v2 tables対応中かも @yusufyildiz34 が 28 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/iceberg#18632 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToList対応中かも @mohamed-elbrik が 34 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
area: cli
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
vitruv-tools/NeoJoin#415 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
メンテナーはふだん 6 日以内に返信
-
account assessment course feature lecture
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
bug db/dameng user-priority/P2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
docs: document identity-provider types compatibility for Keycloak 26.5+対応中かも @Motouom が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
adorsys/keycloak-config-cli#1766 ·
メンテナーはふだん 12 日以内に返信