Fix gp_repack docker-compose command
run command will fail with Can't connect to socket.. error for pg_repack
@yegorLitvinov is attempting to deploy a commit to the Sentry Team on Vercel.
A member of the Team first needs to authorize it.
@chendo @BYK Could you please review this pr. Related PR is https://github.com/getsentry/develop/pull/388
@yegorLitvinov looks good. exec is what I have in my own scripts, not sure how that became run here, my bad
Presumably because if you run, it doesn't run Postgres and thus it can't connect to the postgres socket. We run ours in a cronjob while Sentry is running. pg_repack is designed to be run online
Presumably because if you run, it doesn't run Postgres and thus it can't connect to the postgres socket.
Ahh, right as we are overriding the default CMD for Postgres. I think all we need is a postgres or postgres & call in that run line and we don't need exec or the system being up. Would you mind trying that?
@BYK the run command you advised is working well, but I can't check the result as there is not enough space on my disk for pg_repack. @chendo Could you test it?
@yegorLitvinov while this PR fixes the pg_repack command, you still need to install the extension in the database, if it was not installed previously. Here is the full list of commands that I executed and that I would propose documenting instead:
- Go inside the
postgrescontainer:docker compose exec postgres bash - Install packages
apt update && apt install -y --no-install-recommends postgresql-14-repack - Create extension:
psql -c "CREATE EXTENSION pg_repack" -d <DB_NAME> -U <DB_USERNAME> - Run
pg_repack:pg_repack -E info -t nodestore_node -d <DB_NAME> -U <DB_USERNAME> - Optionally, drop the extension:
psql -c "DROP EXTENSION pg_repack" -d <DB_NAME> -U <DB_USERNAME>