Skip to content

clickhouse-server docker initdb script sourcing ignores errors #10183

@abraithwaite

Description

@abraithwaite

Investigating some flaky builds we found that the initdb script doesn't check errors or issue retries for failed migrations:

for f in /docker-entrypoint-initdb.d/*; do
case "$f" in
*.sh)
if [ -x "$f" ]; then
echo "$0: running $f"
"$f"
else
echo "$0: sourcing $f"
. "$f"
fi
;;
*.sql) echo "$0: running $f"; cat "$f" | "${clickhouseclient[@]}" ; echo ;;
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${clickhouseclient[@]}"; echo ;;
*) echo "$0: ignoring $f" ;;
esac
echo
done

Occasionally on our CI, the clickhouse client connection to zookeeper unexpectedly closes, which in turn causes the initial migration script to fail silently.

Zookeeper issues aside, I believe that the script should at least be checking that the migrations applied successfully (return code from clickhouse-client is 0).

Metadata

Metadata

Assignees

Labels

bugConfirmed user-visible misbehaviour in official releasedocker

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions