Re: Inconsistent DB data in Streaming Replication

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>, 'Fujii Masao' <masao(dot)fujii(at)gmail(dot)com>, 'Andres Freund' <andres(at)2ndquadrant(dot)com>, 'Hannu Krosing' <hannu(at)2ndquadrant(dot)com>, 'Sameer Thakur' <samthakur74(at)gmail(dot)com>, 'Ants Aasma' <ants(at)cybertec(dot)at>, sthomas(at)optionshouse(dot)com, 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 'Samrat Revagade' <revagade(dot)samrat(at)gmail(dot)com>, 'PostgreSQL-development' <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Inconsistent DB data in Streaming Replication
Date: 2013-04-19 12:46:02
Message-ID: 20130419124601.GA31466@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 17, 2013 at 12:49:10PM +0200, Florian Pflug wrote:
> Fixing this on the receive side alone seems quite messy and fragile.
> So instead, I think we should let the master send a shutdown message
> after it has sent everything it wants to send, and wait for the client
> to acknowledge it before shutting down the socket.
>
> If the client fails to respond, we could log a fat WARNING.

ISTM the master should half close the socket, using shutdown(). That
way the client receives an EOF and can still then send its reply to the
master. Then when the master receives that it can close() completely.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.
-- Arthur Schopenhauer

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-04-19 13:30:33 Re: Recovery target 'immediate'
Previous Message Rushabh Lathia 2013-04-19 12:01:44 elog() error, trying CURENT OF with foreign table