Change the option name to no-kill-backend.

For consistency with other slimilar option such as no-order,
no-analyze.
This commit is contained in:
Masahiko Sawada 2017-02-22 03:49:04 +00:00
parent ff8cb96c74
commit f6c1304c36
4 changed files with 10 additions and 10 deletions

View File

@ -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");
}

View File

@ -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.

View File

@ -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"

View File

@ -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