Introduce --dont-kill-backend option.

pg_repack needs to take an exclusive lock at the end of the
reorganization. If the lock cannot be taken after duration
--wait-timeout option specified and this option is true,
pg_repack gives up to repack a target table instead of
cancelling conflicting backend. False by default.
This commit is contained in:
Masahiko Sawada
2017-01-19 18:26:13 +09:00
parent 6cadd7d97d
commit 34c6506f54
4 changed files with 99 additions and 43 deletions

View File

@ -387,3 +387,8 @@ ERROR: cannot repack specific table(s) in schema, use schema.table notation inst
-- => ERROR
\! pg_repack --dbname=contrib_regression --all --schema=test_schema1
ERROR: cannot repack specific schema(s) in all databases
--
-- don't kill backend
--
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --dont-kill-backend
INFO: repacking table "tbl_cluster"

View File

@ -230,3 +230,8 @@ CREATE TABLE test_schema2.tbl2 (id INTEGER PRIMARY KEY);
\! pg_repack --dbname=contrib_regression --schema=test_schema1 --table=tbl1
-- => ERROR
\! pg_repack --dbname=contrib_regression --all --schema=test_schema1
--
-- don't kill backend
--
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --dont-kill-backend