pgpool2.git / summary / log / commit / refs

commit    0dff894c2d184eb7cf9471d2e276d092b191ee60
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Sat Jun 21 10:23:02 2014 +0000

    Disbale statement_timeout while executing online recovery.
    
    Online may take very long time and user may enable statement
    timeout. To prevent online recovery canceled by statement timeout,
    disable statement timeout in the connection used by online recovery.
    
    See [pgpool-general: 2919] for whole story.


src/pcp_con/recovery.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pcp_con/recovery.c b/src/pcp_con/recovery.c index 27d4e9b4c..b5f5fc640 100644 --- a/src/pcp_con/recovery.c +++ b/src/pcp_con/recovery.c @@ -5,7 +5,7 @@ * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * - * Copyright (c) 2003-2013 PgPool Global Development Group + * Copyright (c) 2003-2014 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby @@ -273,6 +273,15 @@ static int exec_recovery(PGconn *conn, BackendInfo *master_backend, BackendInfo master_backend->backend_port); pool_log("starting recovery command: \"%s\"", recovery_command); + pool_log("disabling statement_timeout"); + result = PQexec(conn, "SET statement_timeout To 0"); + r = (PQresultStatus(result) != PGRES_COMMAND_OK); + if (r != 0) + { + pool_error("exec_recovery: SET STATEMENT_TIMEOUT failed at %s", + (stage == FIRST_STAGE) ? "1st stage" : "2nd stage"); + } + PQclear(result); pool_debug("exec_recovery: start recovery"); result = PQexec(conn, recovery_command); [parent: 32ed2d1e14a0]