From f6c1304c36d7335c545c0ce56f7efdfd19881029 Mon Sep 17 00:00:00 2001 From: Masahiko Sawada Date: Wed, 22 Feb 2017 03:49:04 +0000 Subject: [PATCH] Change the option name to no-kill-backend. For consistency with other slimilar option such as no-order, no-analyze. --- bin/pg_repack.c | 10 +++++----- doc/pg_repack.rst | 6 +++--- regress/expected/repack.out | 2 +- regress/sql/repack.sql | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/pg_repack.c b/bin/pg_repack.c index 075207f..fa2e601 100644 --- a/bin/pg_repack.c +++ b/bin/pg_repack.c @@ -249,7 +249,7 @@ static int wait_timeout = 60; /* in seconds */ static int jobs = 0; /* number of concurrent worker conns. */ static bool dryrun = false; static unsigned int temp_obj_num = 0; /* temporary objects counter */ -static bool dont_kill_backend = false; /* abandon when timed-out */ +static bool no_kill_backend = false; /* abandon when timed-out */ /* buffer should have at least 11 bytes */ static char * @@ -275,7 +275,7 @@ static pgut_option options[] = { 'i', 'T', "wait-timeout", &wait_timeout }, { 'B', 'Z', "no-analyze", &analyze }, { 'i', 'j', "jobs", &jobs }, - { 'b', 'D', "dont-kill-backend", &dont_kill_backend }, + { 'b', 'D', "no-kill-backend", &no_kill_backend }, { 0 }, }; @@ -1486,7 +1486,7 @@ kill_ddl(PGconn *conn, Oid relid, bool terminate) /* Competing backend is exsits, but if we do not want to calcel/terminate * any backend, do nothing. */ - if (dont_kill_backend) + if (no_kill_backend) { elog(WARNING, "%d unsafe queries remain but do not cancel them", n_tuples); @@ -1681,7 +1681,7 @@ lock_exclusive(PGconn *conn, const char *relid, const char *lock_query, bool sta duration = time(NULL) - start; if (duration > wait_timeout) { - if (dont_kill_backend) + if (no_kill_backend) { elog(WARNING, "timed out, do not cancel conflicting backends"); ret = false; @@ -2101,6 +2101,6 @@ pgut_help(bool details) printf(" -i, --index=INDEX move only the specified index\n"); printf(" -x, --only-indexes move only indexes of the specified table\n"); printf(" -T, --wait-timeout=SECS timeout to cancel other backends on conflict\n"); - printf(" -D, --dont-kill-backend do not kill other backends when timed out\n"); + printf(" -D, --no-kill-backend don't kill other backends when timed out\n"); printf(" -Z, --no-analyze don't analyze at end\n"); } diff --git a/doc/pg_repack.rst b/doc/pg_repack.rst index a607e86..d1e7952 100644 --- a/doc/pg_repack.rst +++ b/doc/pg_repack.rst @@ -127,7 +127,7 @@ Options: -i, --index=INDEX move only the specified index -x, --only-indexes move only indexes of the specified table -T, --wait-timeout=SECS timeout to cancel other backends on conflict - -D, --dont-kill-backend do not kill other backends when timed out + -D, --no-kill-backend don't kill other backends when timed out -Z, --no-analyze don't analyze at end Connection options: @@ -202,13 +202,13 @@ Reorg Options pg_repack needs to take an exclusive lock at the end of the reorganization. This setting controls how many seconds pg_repack will wait to acquire this lock. If the lock cannot be taken after this duration - and ``--dont-kill-backend`` option is not specified, pg_repack will forcibly + and ``--no-kill-backend`` option is not specified, pg_repack will forcibly cancel the conflicting queries. If you are using PostgreSQL version 8.4 or newer, pg_repack will fall back to using pg_terminate_backend() to disconnect any remaining backends after twice this timeout has passed. The default is 60 seconds. -``-D``, ``--dont-kill-backend`` +``-D``, ``--no-kill-backend`` Skip to repack table if the lock cannot be taken for duration specified ``--wait-timeout``, instead of cancelling conflicting queries. The default is false. diff --git a/regress/expected/repack.out b/regress/expected/repack.out index f77669b..816f41c 100644 --- a/regress/expected/repack.out +++ b/regress/expected/repack.out @@ -390,5 +390,5 @@ ERROR: cannot repack specific schema(s) in all databases -- -- don't kill backend -- -\! pg_repack --dbname=contrib_regression --table=tbl_cluster --dont-kill-backend +\! pg_repack --dbname=contrib_regression --table=tbl_cluster --no-kill-backend INFO: repacking table "tbl_cluster" diff --git a/regress/sql/repack.sql b/regress/sql/repack.sql index 45e9296..2353262 100644 --- a/regress/sql/repack.sql +++ b/regress/sql/repack.sql @@ -234,4 +234,4 @@ CREATE TABLE test_schema2.tbl2 (id INTEGER PRIMARY KEY); -- -- don't kill backend -- -\! pg_repack --dbname=contrib_regression --table=tbl_cluster --dont-kill-backend +\! pg_repack --dbname=contrib_regression --table=tbl_cluster --no-kill-backend