a warm standby takes over, hot standby does not catch up

From: bo gu <coopci(at)msn(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: a warm standby takes over, hot standby does not catch up
Date: 2011-04-23 09:40:59
Message-ID: SNT131-w24E0E2FF4A56C2607DEA16DC940@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


Recently, I crafted my site like this to achieve HA and load balancing:

----------------------
| Apache |
| | |
| read | ...... many of this
| | |
| V |
|postgresql READ ONLY|
----------------------
Λ
|
restore_command
|
   -----------------
   | WAL archive | actually I have two of this. Only one is depicted for simlicity.
   -----------------
  Λ |
  | restore_command
archive_command |
| V
-------------------- --------------------------
|postgresql MASTER| |postgresql WARM STANDBY|
-------------------- --------------------------

I encounted a serious problem: if the MASTER crashes, and the WARM STANDBY takes over:

----------------------
| Apache |
| | |
| read | ...... many of this
| | |
| V |
|postgresql READ ONLY|
----------------------
Λ
|
restore_command
|
    -----------------
    | WAL archive |
    -----------------
   Λ
   |
archive_command
|
------------------------------- -----------------------------------------
|postgresql former MASTER x_x| |postgresql former WARM STANDBY  ̄ ̄|
------------------------------- -----------------------------------------

I noticed that the warm standby starts a new time line when it generate WAL archive in place of the former MASTER. BUT the read only ones do not know this change and insist on finding the next WAL file of the old time line.
So how do I notice the read only ones that they should switch to a new time line?

Browse pgsql-admin by date

  From Date Subject
Next Message Erwin Brandstetter 2011-04-23 22:54:13 Re: DELETE FROM pg_description WHERE ...
Previous Message Tom Lane 2011-04-23 03:21:58 Re: DELETE FROM pg_description WHERE ...