Re: Pipeline mode and PQpipelineSync()
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Boris Kolpackov <boris@codesynthesis.com>
Cc: pgsql-hackers@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>, Andrew Dunstan <andrew@dunslane.net>, Peter Geoghegan <pg@bowt.ie>
Date: 2021-07-10T16:26:56Z
Lists: pgsql-hackers
On 2021-Jul-08, Boris Kolpackov wrote: > Alvaro Herrera <alvaro.herrera@2ndquadrant.com> writes: > > > To be honest, I am hesitant to changing the charter in that way; I fear > > it may have consequences I don't foresee. I think the workaround is not > > *that* bad. > > Ok, fair enough. I've updated my code to account for this and it seems > to be working fine now. Great, thanks. I have pushed the fix, so beta3 (when it is released) should work well for you. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=ab09679429009bfed4bd894a6187afde0b7bdfcd > How about the following for the second sentence: > > "In particular, a call to <function>PQisBusy</function> in the middle > of a pipeline returns 0 if all the results for queries issued so far > have been consumed." I used this wording, thanks. On 2021-Jul-08, Alvaro Herrera wrote: > Looking at this again, I noticed that I could probably do away with the > switch on pipelineStatus, and just call pqPipelineProcessQueue in all > cases when appending commands to the queue; I *think* that will do the > right thing in all cases. *Except* that I don't know what will happen > if the program is in the middle of processing a result in single-row > mode, and then sends another query: that would wipe out the pending > results of the query being processed ... but maybe that problem can > already occur in some other way. I tried this and it doesn't work. It doesn't seem interesting to pursue anyway, so I'll just drop the idea. (I did notice that the comment on single-row mode was wrong, though, since pqPipelineProcessQueue does nothing in READY_MORE state, which is what it is in the middle of processing a result.) Thanks for all the help in testing and reviewing, -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ "El hombre nunca sabe de lo que es capaz hasta que lo intenta" (C. Dickens)
Commits
-
libpq: Fix sending queries in pipeline aborted state
- ab0967942900 15.0 landed
- 1beaa654da61 14.0 landed
-
Fix libpq state machine in pipeline mode
- b71a9cb31e46 15.0 landed
- 690339fcd587 14.0 landed
-
Add PQsendFlushRequest to libpq
- a7192326c74d 15.0 landed
- 69cf1d5429d4 14.0 landed