Re: PATCH: Batch/pipelining support for libpq
Daniel Verite <daniel@manitou-mail.org>
From: "Daniel Verite" <daniel@manitou-mail.org>
To: "Michael Paquier" <michael.paquier@gmail.com>
Cc: "Vaishnavi Prabakaran" <vaishnaviprabakaran@gmail.com>,"Prabakaran,
Vaishnavi" <VaishnaviP@fast.au.fujitsu.com>,"Craig Ringer"
<craig@2ndquadrant.com>,"Haribabu Kommi"
<kommi.haribabu@gmail.com>,"Tsunakawa, Takayuki"
<tsunakawa.takay@jp.fujitsu.com>,"Dmitry Igrishin"
<dmitigr@gmail.com>,"Andres Freund" <andres@anarazel.de>,"PostgreSQL
Hackers" <pgsql-hackers@postgresql.org>,"Manuel Kniep"
<m.kniep@web.de>,"fujita.etsuro@lab.ntt.co.jp"
<fujita.etsuro@lab.ntt.co.jp>,"Iwata, Aya" <iwata.aya@jp.fujitsu.com>
Date: 2017-03-28T13:28:52Z
Lists: pgsql-hackers
Michael Paquier wrote: > # Running: testlibpqbatch dbname=postgres 10000 copyfailure > dispatching SELECT query failed: cannot queue commands during COPY > > COPYBUF: 5 > > Error status and message got from server due to COPY command failure > are : PGRES_FATAL_ERROR ERROR: unexpected message type 0x50 during > COPY from stdin > CONTEXT: COPY batch_demo, line 1 Same result here. BTW the doc says: "In batch mode only asynchronous operations are permitted, and COPY is not recommended as it most likely will trigger failure in batch processing" Yet it seems that the test assumes that it should work nonetheless. I don't quite understand what we expect of this test, given what's documented. Or what am I missing? While looking at the regress log, I noticed multiple spurious test_singlerowmode tests among the others. Should be fixed with: --- a/src/test/modules/test_libpq/testlibpqbatch.c +++ b/src/test/modules/test_libpq/testlibpqbatch.c @@ -1578,6 +1578,7 @@ main(int argc, char **argv) run_batch_abort = 0; run_timings = 0; run_copyfailure = 0; + run_singlerowmode = 0; if (strcmp(argv[3], "disallowed_in_batch") == 0) run_disallowed_in_batch = 1; else if (strcmp(argv[3], "simple_batch") == 0) There's also the fact that this test doesn't care whether it fails (compare with all the "goto fail" of the other tests). And it happens that PQsetSingleRowMode() fails after the call to PQbatchQueueProcess() that instantiates a PGresult of status PGRES_BATCH_END to indicate the end of the batch, To me this shows how this way of setting the single row mode is not ideal. In order to avoid the failure, the loop should know in advance what kind of result it's going to dequeue before calling PQgetResult(), which doesn't feel right. Best regards, -- Daniel Vérité PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite
Commits
-
Add libpq pipeline mode support to pgbench
- 9aa491abbf07 14.0 landed
-
Implement pipeline mode in libpq
- acb7e4eb6b1c 14.0 landed