Re: .ready and .done files considered harmful

Поиск
Список
Период
Сортировка
Искать
От
Bossart, Nathan
Тема
Re: .ready and .done files considered harmful
Дата
Msg-id
273A6E6D-DCC1-4719-96D2-609D5ADA3EA7@amazon.com
Ответ на
Список
Дерево обсуждения
.ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Andres Freund <andres@anarazel.de>
Re: .ready and .done files considered harmful Andrey Borodin <x4mmm@yandex-team.ru>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Hannu Krosing <hannuk@google.com>
Re: .ready and .done files considered harmful Andres Freund <andres@anarazel.de>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful Stephen Frost <sfrost@snowman.net>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: .ready and .done files considered harmful Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful David Steele <david@pgmasters.net>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful "Bossart, Nathan" <bossartn@amazon.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful Dilip Kumar <dilipbalaut@gmail.com>
Re: .ready and .done files considered harmful Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>
Re: .ready and .done files considered harmful Dipesh Pandit <dipesh.pandit@gmail.com>
Re: .ready and .done files considered harmful Dilip Kumar <dilipbalaut@gmail.com>
Re: .ready and .done files considered harmful Dilip Kumar <dilipbalaut@gmail.com>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Stephen Frost <sfrost@snowman.net>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Stephen Frost <sfrost@snowman.net>
Re: .ready and .done files considered harmful Andres Freund <andres@anarazel.de>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Andres Freund <andres@anarazel.de>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Stephen Frost <sfrost@snowman.net>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
Re: .ready and .done files considered harmful Stephen Frost <sfrost@snowman.net>
Re: .ready and .done files considered harmful Dilip Kumar <dilipbalaut@gmail.com>
Re: .ready and .done files considered harmful Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: .ready and .done files considered harmful Robert Haas <robertmhaas@gmail.com>
On 8/17/21, 5:53 AM, "Dipesh Pandit"  wrote:
>> I personally don't think it's necessary to use an atomic here.  A
>> spinlock or LWLock would probably work just fine, as contention seems
>> unlikely.  If we use a lock, we also don't have to worry about memory
>> barriers.
>
> History file should be archived as soon as it gets created. The atomic flag
> here will make sure that there is no reordering of read/write instructions while
> accessing the flag in shared memory. Archiver needs to read this flag at the 
> beginning of each cycle. Write to atomic flag is synchronized and it provides 
> a lockless read. I think an atomic flag here is an efficient choice unless I am 
> missing something.

Sorry, I think my note was not very clear.  I agree that a flag should
be used for this purpose, but I think we should just use a regular
bool protected by a spinlock or LWLock instead of an atomic.  The file
atomics.h has the following note:

 * Use higher level functionality (lwlocks, spinlocks, heavyweight locks)
 * whenever possible. Writing correct code using these facilities is hard.

IOW I don't think the extra complexity is necessary.  From a
performance standpoint, contention seems unlikely.  We only need to
read the flag roughly once per WAL segment, and we only ever set it in
uncommon scenarios such as a timeline switch or the creation of an
out-of-order .ready file.

Nathan

В списке pgsql-hackers по дате отправления
От: Stephen Frost
Дата:
От: Julien Rouhaud
Дата:
FAQ