From: | Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix walsender failure at promotion. |
Date: | 2013-05-08 17:31:00 |
Message-ID: | E1Ua8Ci-000213-Lr@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix walsender failure at promotion.
If a standby server has a cascading standby server connected to it, it's
possible that WAL has already been sent up to the next WAL page boundary,
splitting a WAL record in the middle, when the first standby server is
promoted. Don't throw an assertion failure or error in walsender if that
happens.
Also, fix a variant of the same bug in pg_receivexlog: if it had already
received WAL on previous timeline up to a segment boundary, when the
upstream standby server is promoted so that the timeline switch record falls
on the previous segment, pg_receivexlog would miss the segment containing
the timeline switch. To fix that, have walsender send the position of the
timeline switch at end-of-streaming, in addition to the next timeline's ID.
It was previously assumed that the switch happened exactly where the
streaming stopped.
Note: this is an incompatible change in the streaming protocol. You might
get an error if you try to stream over timeline switches, if the client is
running 9.3beta1 and the server is more recent. It should be fine after a
reconnect, however.
Reported by Fujii Masao.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/2ffa66f4975c99e52984f7ee81b47d137b5b4751
Modified Files
--------------
doc/src/sgml/protocol.sgml | 13 ++-
src/backend/access/transam/xlog.c | 5 +-
.../libpqwalreceiver/libpqwalreceiver.c | 7 +-
src/backend/replication/walreceiverfuncs.c | 7 +-
src/backend/replication/walsender.c | 60 ++++++++++-----
src/bin/pg_basebackup/pg_receivexlog.c | 10 ++-
src/bin/pg_basebackup/receivelog.c | 83 +++++++++++++++++--
7 files changed, 142 insertions(+), 43 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2013-05-08 18:00:02 | Re: Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint |
Previous Message | Tom Lane | 2013-05-08 16:30:31 | Re: Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint |