Note that there are some explanatory texts on larger screens.

plurals
  1. POPostgresql pg_standby takes forever to perform failover
    primarykey
    data
    text
    <p>I have a working WAL shipping setup with a warm standby slave server applying the WAL files.</p> <p>When I create the pg_standby trigger file, it detects this at once, but it takes about 10-15 minutes to actually be ready for accepting connections. Most of the time is spent waiting for .history files.</p> <p>The trigger file is empty, so a "smart" failover should be done. Can I do something to make failover (much) faster?</p> <p>Log output:</p> <pre><code>WAL file not present yet. Checking for trigger file... trigger file found: smart failover LOG: could not open file "pg_xlog/000000010000000000000089" (log file 0, segment 137): No such file or directory LOG: redo done at 0/88003428 LOG: last completed transaction was at log time 2010-08-10 13:26:20.232799+00 Trigger file : /psql_archive/role.master Waiting for WAL file : 000000010000000000000088 WAL file path : /psql_archive/000000010000000000000088 Restoring to : pg_xlog/RECOVERYXLOG Sleep interval : 60 seconds Max wait interval : 0 forever Command for restore : cp "/psql_archive/000000010000000000000088" "pg_xlog/RECOVERYXLOG" Keep archive history : 000000000000000000000000 and later trigger file found: smart failover running restore : OK LOG: restored log file "000000010000000000000088" from archive Trigger file : /psql_archive/role.master Waiting for WAL file : 00000002.history WAL file path : /psql_archive/00000002.history Restoring to : pg_xlog/RECOVERYHISTORY Sleep interval : 60 seconds Max wait interval : 0 forever Command for restore : cp "/psql_archive/00000002.history" "pg_xlog/RECOVERYHISTORY" Keep archive history : 000000000000000000000000 and later running restore :cp: cannot stat `/psql_archive/00000002.history': No such file or directory cp: cannot stat `/psql_archive/00000002.history': No such file or directory cp: cannot stat `/psql_archive/00000002.history': No such file or directory cp: cannot stat `/psql_archive/00000002.history': No such file or directory not restored history file not found LOG: selected new timeline ID: 2 Trigger file : /psql_archive/role.master Waiting for WAL file : 00000001.history WAL file path : /psql_archive/00000001.history Restoring to : pg_xlog/RECOVERYHISTORY Sleep interval : 60 seconds Max wait interval : 0 forever Command for restore : cp "/psql_archive/00000001.history" "pg_xlog/RECOVERYHISTORY" Keep archive history : 000000000000000000000000 and later running restore :cp: cannot stat `/psql_archive/00000001.history': No such file or directory cp: cannot stat `/psql_archive/00000001.history': No such file or directory cp: cannot stat `/psql_archive/00000001.history': No such file or directory cp: cannot stat `/psql_archive/00000001.history': No such file or directory not restored history file not found LOG: archive recovery complete LOG: autovacuum launcher started LOG: database system is ready to accept connections </code></pre> <p>Thanks.</p> <p>-dennis</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload