New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialization of the database only once in Docker. #50724
Initialization of the database only once in Docker. #50724
Conversation
8af12ee
to
7ca9f56
Compare
568c3fc
to
4766f22
Compare
wdyt @Felixoid |
This is an automated comment for commit 3ed7cff with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page Successful checks
|
It makes sense to implement it similarly to mysql and postgresql images, so it requires some refactoring to make it nices |
6ab6d41
to
3f135fb
Compare
@Felixoid is it OK now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks OK to me, asking for another pair of eyes though
BTW do we have at least some trivial tests that use this docker images? Maybe it is time to add some... |
1 time-out test for the debug build looks ok, it succeeded everywhere else |
…1b8e9b171067944199bc6b1eb8b32 Cherry pick #50724 to 23.3: Initialization of the database only once in Docker.
…1b8e9b171067944199bc6b1eb8b32 Cherry pick #50724 to 23.8: Initialization of the database only once in Docker.
Backport #50724 to 23.8: Initialization of the database only once in Docker.
Backport #50724 to 23.3: Initialization of the database only once in Docker.
Couldn't you have left the previous option for developer mode? It was convenient to immediately add the creation of new entities to the initialization script. Now we have to come up with workarounds. |
This change is inconvenient if we still need to add some init steps even if the database exists. I am using it to:
|
Recent versions of ClickHouse do not execute the provided entrypoint script when the database exists. Workaround this by using our own entrypoint and use it in place of the official one. See ClickHouse/ClickHouse#50724.
Ok, looking forward to another PR with improvement. |
…1b8e9b171067944199bc6b1eb8b32 Cherry pick #50724 to 23.9: Initialization of the database only once in Docker.
Backport #50724 to 23.9: Initialization of the database only once in Docker.
Recent versions of ClickHouse do not execute the provided entrypoint script when the database exists. Workaround this by using our own entrypoint and use it in place of the official one. See ClickHouse/ClickHouse#50724.
Changelog category:
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
If the database is already initialized, it doesn't need to be initialized again upon subsequent launches. This can potentially fix the issue of infinite container restarts when the database fails to load within 1000 attempts (relevant for very large databases and multi-node setups).