Re: Doesn't pgstat_report_wal() handle the argument "force" incorrectly

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Doesn't pgstat_report_wal() handle the argument "force" incorrectly
Дата
Msg-id ZREc8dGx2EBlJx4x@paquier.xyz
обсуждение исходный текст
Ответ на Re: Doesn't pgstat_report_wal() handle the argument "force" incorrectly  (Ryoga Yoshida <bt23yoshidar@oss.nttdata.com>)
Ответы Re: Doesn't pgstat_report_wal() handle the argument "force" incorrectly  (Ryoga Yoshida <bt23yoshidar@oss.nttdata.com>)
Список pgsql-hackers
On Mon, Sep 25, 2023 at 02:16:22PM +0900, Ryoga Yoshida wrote:
> On 2023-09-25 12:47, Michael Paquier wrote:
> in attached file
>> +    /* like in pgstat.c, don't wait for lock acquisition when !force */
>
> Isn't it the case with force=true and !force that it doesn't wait for the
> lock acquisition.  In fact, force may be false.

We would not wait on the lock if force=false, which would do
nowait=true.  And !force reads the same to me as force=false.

Anyway, I am OK to remove this part.  That seems to confuse you, so
you may not be the only one who would read this comment.

Another idea would be to do like in pgstat.c by adding the following
line, then use "nowait" to call each sub-function:
nowait = !force;
pgstat_flush_wal(nowait);
pgstat_flush_io(nowait);
--
Michael

Вложения

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

Предыдущее
От: "Hayato Kuroda (Fujitsu)"
Дата:
Сообщение: RE: pg_upgrade and logical replication
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Re: [PoC] pg_upgrade: allow to upgrade publisher node