Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error
Дата
Msg-id 20230217203512.eewdaaqpflauorvv@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error  (Andres Freund <andres@anarazel.de>)
Ответы Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
On 2023-Feb-13, Andres Freund wrote:

> There's something wrong with the patch, it reliably fails with core dumps:
> https://cirrus-ci.com/github/postgresql-cfbot/postgresql/commitfest%2F42%2F3260

I think this would happen on machines where sizeof(bool) is not 1 (which
mine is evidently not).  Fixed.

In addition, there was the problem that the psprintf() to generate the
command name would race against each other if you had multiple threads.
I changed the code so that the name to prepare each statement under is
generated when the Command struct is first initialized, which occurs
before the threads are started.  One small issue is that now we use a
single counter for all commands of all scripts, rather than a
script-local counter.  This doesn't seem at all important.


I did realize that Nagata-san was right that we've always prepared the
whole script in advance; that behavior was there already in commit
49639a7b2c52 that introduced -Mprepared.  We've never done each command
just before executing it.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
Y una voz del caos me habló y me dijo
"Sonríe y sé feliz, podría ser peor".
Y sonreí. Y fui feliz.
Y fue peor.

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: wrong query result due to wang plan
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Move defaults toward ICU in 16?