File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -249,12 +249,13 @@ Requires=zfs-mount.service
249249Type=forking
250250User=postgres
251251Group=postgres
252- ExecStart=${PG_BIN} /pg_ctl start -t 3600 -D ${DATA_DIR} -l ${DATA_DIR} /postgresql.log
252+ # Long timeout (2 hours) to allow WAL replay for large databases (e.g., 1TB+ databases can take 30+ minutes)
253+ ExecStart=${PG_BIN} /pg_ctl start -t 7200 -D ${DATA_DIR} -l ${DATA_DIR} /postgresql.log
253254ExecStop=${PG_BIN} /pg_ctl stop -D ${DATA_DIR} -m fast
254255ExecReload=${PG_BIN} /pg_ctl reload -D ${DATA_DIR}
255256KillMode=mixed
256257KillSignal=SIGINT
257- TimeoutStartSec=3600
258+ TimeoutStartSec=7200
258259TimeoutStopSec=300
259260Restart=on-failure
260261RestartSec=5s
@@ -288,7 +289,16 @@ while [ ${RETRY_COUNT} -lt ${MAX_RETRIES} ]; do
288289 sleep 1
289290done
290291
291- # 8. Clean up pgBackRest config (contains credentials)
292+ # 8. Clean up Crunchy Bridge internal schemas and extensions
293+ log " Cleaning up schemas and extensions..."
294+
295+ sudo -u postgres ${PG_BIN} /psql -p ${PG_PORT} -h 127.0.0.1 -d ${DATABASE_NAME} << 'EOSQL '
296+ DROP SCHEMA IF EXISTS perfsnap CASCADE;
297+ DROP SCHEMA IF EXISTS hint_plan CASCADE;
298+ DROP EXTENSION IF EXISTS crunchy_pooler CASCADE;
299+ DROP EXTENSION IF EXISTS pg_stat_statements CASCADE;
300+ EOSQL
301+
292302log " Cleaning up pgBackRest config..."
293303if [ -f " ${PGBACKREST_CONF} " ]; then
294304 rm -f " ${PGBACKREST_CONF} " || log " Warning: Could not remove pgBackRest config"
You can’t perform that action at this time.
0 commit comments