Re: BUG #3855: backend sends corrupted data onEHOSTDOWNerror

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Scot Loach <sloach(at)sandvine(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3855: backend sends corrupted data onEHOSTDOWNerror
Date: 2008-03-25 00:49:04
Message-ID: 200803250049.m2P0n4J21443@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Email removed from patch queue --- Tom indicates this is an operating
system bug. Perhaps if we get more bug reports we will have to address
it.

---------------------------------------------------------------------------

Scot Loach wrote:
> Yes that is what I am trying to explain.
> So I think this is still a bug that should be fixed in the backend code.
>
> scot.
>
>
> -----Original Message-----
> From: Jeff Davis [mailto:pgsql(at)j-davis(dot)com]
> Sent: Tuesday, January 08, 2008 2:40 PM
> To: Scot Loach
> Cc: pgsql-bugs(at)postgresql(dot)org
> Subject: RE: [BUGS] BUG #3855: backend sends corrupted data
> onEHOSTDOWNerror
>
> On Tue, 2008-01-08 at 14:06 -0500, Scot Loach wrote:
> > I agree this would be fine if PostgreSQL works the way you say below.
> >
> > However, PostgreSQL does not look at the # of bytes written and
> > continue sending after that many bytes. PostgreSQL actually simply
> > clears its buffer of bytes to send on this error, in this code:
> >
> > pqcomm.c:1075
> > /*
> > * We drop the buffered data anyway so that processing can
> > * continue, even though we'll probably quit soon.
> > */
> > PqSendPointer = 0;
> > return EOF;
> >
> >
> > The result as I saw on a system where this was occurring, was that
> > when PostgreSQL was sending back a large result set, there was simply
> > a fragment of it missing.
>
> I think I see what you are saying. I was thinking about fe-misc.c, where
> it explicitly says (in the default case of a switch statement of the
> return value):
>
> /* We don't assume it's a fatal error... */
> conn->outCount = 0;
> return -1;
>
> (but that's on the frontend, obviously)
>
> I think the problem you're talking about comes from the callers of
> pq_putmessage, which simply ignore any return value at all (and thus do
> not retransmit the message). I agree that is a problem (assuming I
> understand what's going on).
>
> Regards,
> Jeff Davis
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message eric melbardis 2008-03-25 00:53:08 BUG #4056: problem creating function with domain argument
Previous Message Bruce Momjian 2008-03-25 00:11:57 Re: BUG #3692: Conflicting create table statements throw unexpected error