Re: [HACKERS] Walsender timeouts and large transactions - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: [HACKERS] Walsender timeouts and large transactions
Date
Msg-id CAMsr+YHZ1oKLKe4LJ8Siv3VxS7g7qW+fOzG0xqe4AwZ8V94COg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Walsender timeouts and large transactions  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 6 December 2017 at 04:07, Robert Haas <robertmhaas@gmail.com> wrote:
On Mon, Dec 4, 2017 at 10:59 PM, Craig Ringer <craig@2ndquadrant.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.
 

Entirely my fault - I tend to forget to look at code style when I'm focused on functionality. My apologies, and thanks for the reminder.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: dsa_allocate could not find 4 free pages
Next
From: David Rowley
Date:
Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table