Re: adding wait_start column to pg_locks

Поиск
Список
Период
Сортировка
От torikoshia
Тема Re: adding wait_start column to pg_locks
Дата
Msg-id b8425207811a6b99d0ecd76844906a8e@oss.nttdata.com
обсуждение исходный текст
Ответ на Re: adding wait_start column to pg_locks  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Ответы Re: adding wait_start column to pg_locks  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Список pgsql-hackers
On 2021-02-03 11:23, Fujii Masao wrote:
>> 64-bit fetches are not atomic on some platforms. So spinlock is 
>> necessary when updating "waitStart" without holding the partition 
>> lock? Also GetLockStatusData() needs spinlock when reading 
>> "waitStart"?
> 
> Also it might be worth thinking to use 64-bit atomic operations like
> pg_atomic_read_u64(), for that.

Thanks for your suggestion and advice!

In the attached patch I used pg_atomic_read_u64() and 
pg_atomic_write_u64().

waitStart is TimestampTz i.e., int64, but it seems pg_atomic_read_xxx 
and pg_atomic_write_xxx only supports unsigned int, so I cast the type.

I may be using these functions not correctly, so if something is wrong, 
I would appreciate any comments.


About the documentation, since your suggestion seems better than v6, I 
used it as is.


Regards,

--
Atsushi Torikoshi
Вложения

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

Предыдущее
От: John Naylor
Дата:
Сообщение: get rid of tags in the docs?
Следующее
От: Mahendra Singh Thalor
Дата:
Сообщение: Re: Faulty HEAP_XMAX_LOCK_ONLY & HEAP_KEYS_UPDATED hintbit combination