Dumb mistakes in WalSndWriteData() - Mailing list pgsql-hackers

From Andres Freund
Subject Dumb mistakes in WalSndWriteData()
Date
Msg-id 20161031085940.q6kyakvukgtpjyks@alap3.anarazel.de
Whole thread Raw
Responses Re: Dumb mistakes in WalSndWriteData()  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi,

I^Wsomebody appears to have made a number of dumb mistakes in
WalSndWriteData(), namely:
1) The timestamp is set way too late, after  pq_putmessage_noblock(). That'll sometimes work, sometimes not.  I  have
noidea how that ended up happening. It's eye-wateringly dumb.
 

2) We only do WalSndKeepaliveIfNecessary() if we're blocked on socket  IO. But on a long-lived connection that might be
alot of data, we  should really do that once *before* trying to send the payload in the  first place.
 

3) Similarly to 2) it might be worthwhile checking for interrupts  everytime, not just when blocked on network IO.

See also:
http://archives.postgresql.org/message-id/CAMsr%2BYE2dSfHVr7iEv1GSPZihitWX-PMkD9QALEGcTYa%2Bsdsgg%40mail.gmail.com

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Logical decoding and walsender timeouts
Next
From: Gilles Darold
Date:
Subject: Re: Patch to implement pg_current_logfile() function