[lake/iceberg] Reserved write-mode properties can be set and reset through their `iceberg.` key
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
Direzione di ricerca
Inizia da applyPropertyChanges in fluss-lake/fluss-lake-iceberg-common/.../IcebergLakeCatalog.java, dove il controllo RESERVED_PROPERTIES viene eseguito sulla chiave Fluss prima che convertFlussPropertyKeyToIceberg rimuova il prefisso iceberg.. Il ramo ResetOption richiede lo stesso controllo. Estendi IcebergLakeCatalogTest.alterReservedTableProperties in modo che passi anche ogni nome riservato con il prefisso iceberg.. È completato quando le chiamate di impostazione e di reset con prefisso falliscono con i messaggi esistenti, i casi con la chiave senza prefisso continuano a fallire e la tabella Iceberg resta invariata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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!
- Lingua principale
- Java
- Stelle
- 2.2k
- Fork
- 656
- Merge medio
- 1g 21h
- PR unite (30g)
- 127
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/fluss
-
[common] Decimal#hashCode is inconsistent with Decimal#equalsForse già presa @firasbouzazi l’ha presa 13 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/fluss#4538 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[security] PlainSaslServerProvider conflicts with Hadoop SASL provider causing authentication failureForse già presa @xinzhang-hello l’ha presa 19 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
[server] KV snapshot scheduling stops permanently after a transient snapshot-init failureForse già presa @zhang-arvin l’ha presa 19 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
apache/fluss#4489 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[docs] Document advertised-resource and ACL principal ignore-case optionsForse già presa @EchoLee5 l’ha presa 31 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
[client] LimitBatchScanner leaks Arrow read context on log-table LIMIT scanForse già presa @EchoLee5 l’ha presa 31 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/fluss
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/rocketmq-dashboard#6896 ·
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenIntegrationEngine/engine#496 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
SasanLabs/VulnerableApp#836 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Albertinesilva/backend-engineering-journey-java-springboot#46 ·