Re: [HACKERS] Walsender timeouts and large transactions

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Yura Sokolov <funny(dot)falcon(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Petr Jelinek <pjmodos(at)pjmodos(dot)net>
Subject: Re: [HACKERS] Walsender timeouts and large transactions
Date: 2017-12-05 20:07:42
Message-ID: CA+TgmoYCnnFXNTk6EuXTxWs9CPg5X5vhOpTYxnsPzjvCfZOKeA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 4, 2017 at 10:59 PM, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:
> To me it looks like it's time to get this committed, marking as such.

This version has noticeably more code rearrangement than before, and
I'm not sure that is actually buying us anything. Why not keep the
changes minimal?

Also, TBH, this doesn't seem to have been carefully reviewed for style:

- if (!pq_is_send_pending())
- return;
+ /* Try taking fast path unless we get too close to walsender timeout. */
+ if (now < TimestampTzPlusMilliseconds(last_reply_timestamp,
+ wal_sender_timeout / 2))
+ {
+ if (!pq_is_send_pending())
+ return;
+ }

Generally we write if (a && b) { ... } not if (a) { if (b) .. }

- }
+ };

It's hard to understand how this got through review.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2017-12-05 20:35:20 Re: dsa_allocate could not find 4 free pages
Previous Message Robert Haas 2017-12-05 19:48:32 Re: [HACKERS] pow support for pgbench