improve comments in entrypoint.clickhouse.sh
This commit is contained in:
@ -1,21 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# clickhouse entrypoint (cc-ci Q4.7b hardening — recipe-PR for recipe-maintainers/plausible).
|
|
||||||
|
# clickhouse-backup is a backup tool (backupbot pre/post-hooks: `clickhouse-backup create/restore`).
|
||||||
|
# It is a 22 MB GitHub download (rate-limit / network), which can fail to download, and lead to crash loop and download throttling.
|
||||||
#
|
#
|
||||||
# clickhouse-backup is the BACKUP tool (backupbot pre/post-hooks: `clickhouse-backup create/restore`).
|
# to make the download smoother:
|
||||||
# It is NOT required for clickhouse-SERVER (`/entrypoint.sh`) to run. The published recipe fetched it
|
# - cache the binary on the persistent clickhouse data volume (/var/lib/clickhouse) so it is fetched
|
||||||
# with `set -ex` + a single silenced no-retry wget to ephemeral /tmp, so ANY transient failure of the
|
|
||||||
# 22 MB GitHub download (rate-limit / network) exited the container BEFORE the server started → swarm
|
|
||||||
# restarted it → re-downloaded → amplified the throttle → crash-loop → deploy timeout (cc-ci Q4.7).
|
|
||||||
#
|
|
||||||
# Hardening (no behaviour change when the download succeeds first try):
|
|
||||||
# - cache the binary on the PERSISTENT clickhouse data volume (/var/lib/clickhouse) so it is fetched
|
|
||||||
# at most once and reused on every container restart (no re-download amplification);
|
# at most once and reused on every container restart (no re-download amplification);
|
||||||
# - retry with backoff to ride out transient GitHub failures;
|
# - retry with backoff to ride out transient GitHub failures
|
||||||
# - un-silenced so a failure is diagnosable in `docker service logs`.
|
|
||||||
#
|
|
||||||
# Policy: clickhouse-backup is REQUIRED. If it cannot be installed after all retries the entrypoint
|
|
||||||
# aborts (non-zero exit) and the server is NOT started — we deliberately fail the deploy loudly rather
|
|
||||||
# than come up silently without backup/restore capability.
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@ -60,8 +51,7 @@ install_clickhouse_backup() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Required: if the backup tool cannot be installed after retries, abort (set -e) so the deploy fails
|
#if the backup tool cannot be installed after retries, it aborts (set -e) so the deploy fails
|
||||||
# loudly instead of coming up without backup/restore capability.
|
|
||||||
install_clickhouse_backup
|
install_clickhouse_backup
|
||||||
|
|
||||||
exec /entrypoint.sh
|
exec /entrypoint.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user