Re: Streaming replication with sync slave, but disconnects due to missing WAL segments

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "Mads(dot)Tandrup(at)schneider-electric(dot)com" <Mads(dot)Tandrup(at)schneider-electric(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Streaming replication with sync slave, but disconnects due to missing WAL segments
Date: 2013-06-05 10:42:57
Message-ID: CAMkU=1wpFx84CTpU3kCL0cUj6VompdDU=L41cpLY5MMLuPhbow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jun 5, 2013 at 1:30 AM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>wrote:

> Jeff Janes wrote:
> > On Tue, Jun 4, 2013 at 6:25 AM, <Mads(dot)Tandrup(at)schneider-electric(dot)com>
> wrote:
> >> I have a question about sync streaming replication.
> >>
> >> I have 2 postgresql 9.1 servers set up with streaming replication. On
> the
> >> master node the slave is configured as a synchronous standby. I've
> verified
> >> that pg_stat_replication shows sync_state = sync for the slave node.
> >>
> >> It all seems to work fine. But I have noticed that sometimes when I
> restore
> >> backups created by pg_dump. The slave node will disconnect with the
> message
> >> in the postgresql log:
> >
> > You cannot use pg_dump to set up a database for receiving streaming
> replication.
> >
> > For that it must be a physical copy, not a logical copy which is what
> pg_dump generates.
>
> I think you misunderstood - he restores a dump on
> the *primary* and that makes replication fall over
> because it cannot catch up.
>

Ah, I see. And the synchronization point doesn't help, because it only
occurs at commit-time and if the dump is being loaded in a single
transaction, then the transaction could last for several checkpoints. By
the time it tries to synchronize, it is already too late.

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2013-06-05 11:28:20 Re: How to modify dump files created by pg_dump
Previous Message Thomas Kellerer 2013-06-05 10:12:11 Re: Synonyms in PostgreSQL 9.2.4