[lake/iceberg] Reserved write-mode properties can be set and reset through their `iceberg.` key
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
fluss-lake/fluss-lake-iceberg-common/.../IcebergLakeCatalog.java の applyPropertyChanges から始めてください。ここでは、convertFlussPropertyKeyToIceberg が iceberg. プレフィックスを取り除く前に、Fluss のキーに対して RESERVED_PROPERTIES のチェックが実行されます。ResetOption のブランチにも同じチェックが必要です。IcebergLakeCatalogTest.alterReservedTableProperties を拡張して、予約名のそれぞれを iceberg. プレフィックス付きでも渡すようにしてください。プレフィックス付きの設定およびリセットの呼び出しが既存のメッセージで失敗し、プレフィックスなしのキーのケースが引き続き失敗し、Iceberg テーブルが変更されないことを確認できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Search before asking
- I searched the issues and found nothing similar.
Fluss version
1.0.0 (latest release). The same code is on main at 25306d8f1.
Please describe the bug
IcebergLakeCatalog reserves three Iceberg table properties: write.merge.mode,
write.update.mode and write.delete.mode (RESERVED_PROPERTIES). A Fluss table sets these to
merge-on-read when it creates a primary-key table, and alterTable is meant to refuse a change
to any of them.
The check runs on the Fluss key, before the iceberg. prefix is removed:
// fluss-lake/fluss-lake-iceberg-common/src/main/java/org/apache/fluss/lake/iceberg/IcebergLakeCatalog.java
// applyPropertyChanges
checkArgument(
!RESERVED_PROPERTIES.contains(option.getKey()), // "iceberg.write.merge.mode"
"Cannot set table property '%s'",
option.getKey());
updateProperties.set(
convertFlussPropertyKeyToIceberg(option.getKey()), // -> "write.merge.mode"
option.getValue());
A key arrives with the prefix, so iceberg.write.merge.mode passes the check, and
convertFlussPropertyKeyToIceberg turns it into write.merge.mode, which is then set. The bare
key write.merge.mode is rejected, but a bare key would map to fluss.write.merge.mode and could
never reach the Iceberg property. As a result, the check never blocks a change that would take
effect. ResetOption has the same problem, and a reset removes the property, so the table falls
back to Iceberg's default, copy-on-write.
IcebergLakeCatalogTest.alterReservedTableProperties passes each bare name from
RESERVED_PROPERTIES to alterTable, so it does not cover the prefixed key.
Steps to reproduce
We ran these against apache/fluss:1.0.0 and apache/fluss-gateway:1.0.0, with Iceberg 1.10.1 on
a REST catalog and MinIO.
-
Create a primary-key table with
table.datalake.enabled = trueand
table.datalake.format = iceberg. The Iceberg table holdswrite.merge.mode,
write.update.modeandwrite.delete.mode, allmerge-on-read. -
Set
iceberg.write.merge.modetocopy-on-write. Through the gateway:PATCH /v1/clusters/iceberg/databases/q4/tables/t4 {"changes":[{"kind":"set_config","key":"iceberg.write.merge.mode","value":"copy-on-write"}]}The request returns 204. The Iceberg table property
write.merge.modebecomes
copy-on-write. The Flink SQL form,
ALTER TABLE t4 SET ('iceberg.write.merge.mode' = 'copy-on-write'), reaches the same
alterTablecall; we did not run it. -
Reset it with
{"kind":"reset_config","key":"iceberg.write.merge.mode"}. The request returns
204, andwrite.merge.modeis removed from the Iceberg table. -
For comparison, set the bare key
write.merge.mode. It fails with
Cannot set table property 'write.merge.mode'.
iceberg.write.update.mode and iceberg.write.delete.mode behave the same way.
Expected
Setting or resetting iceberg.write.merge.mode, iceberg.write.update.mode or
iceberg.write.delete.mode fails with Cannot set table property or
Cannot reset table property, and the Iceberg table is unchanged.
Solution
Check both the key as given and the Iceberg key it converts to. Checking only the converted key
would stop rejecting the bare write.merge.mode, which the existing test expects to fail.
String icebergKey = convertFlussPropertyKeyToIceberg(option.getKey());
checkArgument(
!isReservedProperty(option.getKey(), icebergKey),
"Cannot set table property '%s'",
option.getKey());
updateProperties.set(icebergKey, option.getValue());
private static boolean isReservedProperty(String flussKey, String icebergKey) {
return RESERVED_PROPERTIES.contains(flussKey) || RESERVED_PROPERTIES.contains(icebergKey);
}
ResetOption takes the same check. Extend alterReservedTableProperties to pass each reserved
name both bare and with the iceberg. prefix, and expect both the set and the reset to fail.
Are you willing to submit a PR?
- I'm willing to submit a PR!
- 主要言語
- Java
- スター
- 2.2k
- フォーク
- 658
- 平均マージ
- 2日 23時間
- マージ済み PR(30日)
- 101
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/fluss のほかの issue
-
[common] Decimal#hashCode is inconsistent with Decimal#equals対応中かも @firasbouzazi が 20 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/fluss#4538 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[security] PlainSaslServerProvider conflicts with Hadoop SASL provider causing authentication failure対応中かも @xinzhang-hello が 25 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
[server] KV snapshot scheduling stops permanently after a transient snapshot-init failure対応中かも @zhang-arvin が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
apache/fluss#4489 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[docs] Document advertised-resource and ACL principal ignore-case options対応中かも @EchoLee5 が 38 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
[client] LimitBatchScanner leaks Arrow read context on log-table LIMIT scan対応中かも @EchoLee5 が 38 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
dev/release: verify-release-candidate.sh runs 0 Java tests with Debian's Maven対応中かも @kou が今日担当しました。 オープンType: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/arrow-adbc#4947 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
checkstyle/checkstyle#22153 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
Documentation Needs Triage
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
frankframework/frankframework#11908 ·
メンテナーはふだん 1 日以内に返信