Fix idempotent startup for Flink quickstart docker-compose#15340
Open
kevinjqliu wants to merge 1 commit intoapache:mainfrom
Open
Fix idempotent startup for Flink quickstart docker-compose#15340kevinjqliu wants to merge 1 commit intoapache:mainfrom
kevinjqliu wants to merge 1 commit intoapache:mainfrom
Conversation
Contributor
Author
|
cc @rmoff weird edge case 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to #15124, I noticed an issue when rerunning the quickstart docker container again (
docker compose -f docker/iceberg-flink-quickstart/docker-compose.yml up -d --build)Repro
To reproduce, run the quickstart docker container with the command above, then run the flink sql commands using
docker exec -it jobmanager ./bin/sql-client.sh.Rerun the container and these flink sql commands again;
CREATE TABLEfails without this PR.Flink SQL:
Summary
Fix the Flink quickstart
docker-compose.ymlso thatdocker compose up -d --buildis safe to rerun without breaking the Iceberg REST catalog.Problem
The
create-bucketinit container ranmc rm -r --force minio/warehouseon every execution, wiping all S3 data (metadata JSON, Parquet files, Avro manifests). However, the Iceberg REST catalog's SQLite database persisted inside its running container, leaving it with stale references to deleted metadata files. Any subsequent table operation would fail with:Changes
mc rm -r --force+mc mbwithmc mb --ignore-existingto create the bucket only if it doesn't existtail -f /dev/nullto keep thecreate-bucketcontainer alive, sodocker compose uptreats it as already runningmc ls minio/warehouse) tocreate-bucketand updateiceberg-restto depend onservice_healthy, ensuring the bucket is verified to exist before the catalog startsmc policy setwithmc anonymous setto avoid deprecation warningsuntilloop increate-bucketis no longer needed since it now depends onminio: service_healthyBehavior
docker compose up -d --build(first)docker compose up -d --build(rerun)docker compose down && up