From 9ef8f9f80bb6eaad1154331272c7d419875f74ca Mon Sep 17 00:00:00 2001 From: Masahiko Sawada Date: Wed, 22 Feb 2017 06:03:54 +0000 Subject: [PATCH] Improve error message more explicitely when time out. This change distinguishes error message between failed to cancel query due to time out and abandoning to cancel query due to timeout. --- bin/pg_repack.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/pg_repack.c b/bin/pg_repack.c index fa2e601..ee16d8b 100644 --- a/bin/pg_repack.c +++ b/bin/pg_repack.c @@ -1081,7 +1081,10 @@ repack_one_table(repack_table *table, const char *orderby) if (!(lock_exclusive(connection, buffer, table->lock_table, TRUE))) { - elog(WARNING, "lock_exclusive() failed for %s", table->target_name); + if (no_kill_backend) + elog(INFO, "Skipping repack %s due to timeout", table->target_name); + else + elog(WARNING, "lock_exclusive() failed for %s", table->target_name); goto cleanup; } @@ -1230,7 +1233,10 @@ repack_one_table(repack_table *table, const char *orderby) */ if (!(kill_ddl(connection, table->target_oid, true))) { - elog(WARNING, "kill_ddl() failed."); + if (no_kill_backend) + elog(INFO, "Skipping repack %s due to timeout.", table->target_name); + else + elog(WARNING, "kill_ddl() failed."); goto cleanup; } @@ -1488,7 +1494,7 @@ kill_ddl(PGconn *conn, Oid relid, bool terminate) */ if (no_kill_backend) { - elog(WARNING, "%d unsafe queries remain but do not cancel them", + elog(WARNING, "%d unsafe queries remain but do not cancel them and skip to repack it", n_tuples); ret = false; }