pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yura Sokolov <funny.falcon@postgrespro.ru>
To: pgsql-hackers@postgresql.org
Cc: Petr JelĂ­nek <pjmodos@pjmodos.net>
Subject: Re: Walsender timeouts and large transactions
Date: Wed, 02 Aug 2017 17:35:58 +0000
Message-ID: <20170802173558.1342.32988.pgcf@coridan.postgresql.org> (raw)
In-Reply-To: <cb3d5ccd-de0e-c29d-0b1f-7e38142d0df3@2ndquadrant.com>
References: <e082a56a-fd95-a250-3bae-0fff93832510@2ndquadrant.com>
	<cb3d5ccd-de0e-c29d-0b1f-7e38142d0df3@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

The following review has been posted through the commitfest application:
make installcheck-world:  tested, passed
Implements feature:       not tested
Spec compliant:           not tested
Documentation:            not tested

There is no check for (last_reply_timestamp <= 0 || wal_sender_timeout <= 0) as in other places
(in WalSndKeepaliveIfNecessary for example).

I don't think moving update of 'now' down to end of loop body is correct:
there are calls to ProcessConfigFile with SyncRepInitConfig, ProcessRepliesIfAny that can
last non-negligible time. It could lead to over sleeping due to larger computed sleeptime.
Though I could be mistaken.

I'm not sure about moving `if (!pg_is_send_pending())` in a body loop after WalSndKeepaliveIfNecessary.
Is it necessary? But it looks harmless at least.

Could patch be reduced to check after first `if (!pg_is_sendpending())` ? like:

	if (!pq_is_send_pending())
-		return;
+	{
+		if (last_reply_timestamp <= 0 || wal_sender_timeout <= 0)
+		{
+			CHECK_FOR_INTERRUPTS();
+			return;
+		}
+		if (now <= TimestampTzPlusMilliseconds(last_reply_timestamp, wal_sender_timeout / 2))
+			return;
+	}

If not, what problem prevents?

The new status of this patch is: Waiting on Author

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


view thread (30+ messages)  latest in thread

Message-ID: <20170802173558.1342.32988.pgcf@coridan.postgresql.org>
Permalink:  ../20170802173558.1342.32988.pgcf@coridan.postgresql.org/
Also on:    postgresql.org/message-id/20170802173558.1342.32988.pgcf@coridan.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: funny.falcon@postgrespro.ru, pjmodos@pjmodos.net
  Subject: Re: Walsender timeouts and large transactions
  In-Reply-To: <20170802173558.1342.32988.pgcf@coridan.postgresql.org>
  References: <e082a56a-fd95-a250-3bae-0fff93832510@2ndquadrant.com> <cb3d5ccd-de0e-c29d-0b1f-7e38142d0df3@2ndquadrant.com> <20170802173558.1342.32988.pgcf@coridan.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox