public inbox for [email protected]
help / color / mirror / Atom feedFrom: Jelte Fennema-Nio <[email protected]>
To: PostgreSQL-development <[email protected]>
Subject: Call pqPipelineFlush from PQsendFlushRequest
Date: Tue, 7 Nov 2023 10:38:04 +0100
Message-ID: <CAGECzQTxZRevRWkKodE-SnJk1Yfm4eKT+8E4Cyq3MJ9YKTnNew@mail.gmail.com> (raw)
In pipeline mode after queuing a message to be sent we would flush the
buffer if the size of the buffer passed some threshold. The only message
type that we didn't do that for was the Flush message. This addresses
that oversight.
I noticed this discrepancy while reviewing the
PQsendSyncMessage/PQpipelinePutSync patchset.
Attachments:
[application/octet-stream] v1-0001-Call-pqPipelineFlush-from-PQsendFlushRequest.patch (1.1K, ../CAGECzQTxZRevRWkKodE-SnJk1Yfm4eKT+8E4Cyq3MJ9YKTnNew@mail.gmail.com/2-v1-0001-Call-pqPipelineFlush-from-PQsendFlushRequest.patch)
download | inline diff:
From d14edffd894ebb8066dcd4e2ccd7db5a4c4541ae Mon Sep 17 00:00:00 2001
From: Jelte Fennema-Nio <[email protected]>
Date: Tue, 7 Nov 2023 10:26:10 +0100
Subject: [PATCH v1] Call pqPipelineFlush from PQsendFlushRequest
In pipeline mode after queuing a message to be sent we would flush the
buffer if the size of the buffer passed some treshold. The only message
type that we didn't do that for was the Flush message. This addresses
that oversight.
---
src/interfaces/libpq/fe-exec.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index c6d80ec3968..04610ccf5e8 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -3316,6 +3316,14 @@ PQsendFlushRequest(PGconn *conn)
return 0;
}
+ /*
+ * Give the data a push (in pipeline mode, only if we're past the size
+ * threshold). In nonblock mode, don't complain if we're unable to send
+ * it all; PQgetResult() will do any additional flushing needed.
+ */
+ if (pqPipelineFlush(conn) < 0)
+ return 0;
+
return 1;
}
base-commit: 3c551ebede46194237f82062b54b92e474b5c743
--
2.34.1
view thread (2+ messages)
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: Call pqPipelineFlush from PQsendFlushRequest
In-Reply-To: <CAGECzQTxZRevRWkKodE-SnJk1Yfm4eKT+8E4Cyq3MJ9YKTnNew@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox