Re: Commit Timestamp and LSN Inversion issue

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: Commit Timestamp and LSN Inversion issue
Дата
Msg-id 00888abf-dbda-4a58-8af1-8de6a54f1f4e@wi3ck.info
обсуждение исходный текст
Ответ на Re: Commit Timestamp and LSN Inversion issue  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
On 11/13/24 03:56, Amit Kapila wrote:

> the key point Andres
> is raising is that we won't be able to convert the operation in
> ReserveXLogInsertLocation() to use atomics after such a solution. Now,
> even, if the change is only in the *commit* code path, we may or may
> not be able to maintain two code paths for reserving LSN, one using
> atomics and the other (for commit record) using spinlock.

Which is only partially true. There is nothing that would prevent us 
from using atomic operations inside of a spinlock and only reserving 
xlog space for commit records needs a spinlock because of the extra 
logic that cannot be combined into a single atomic operation. The idea 
as I understand Andres is that changing ReserveXLogInsertLocation() to 
use atomics gets rid not only of the spinlock, but also the LW-locks 
that protect it from a spinlock storm.

Keeping the current LW-lock plus spinlock architecture only for commit 
records but changing the actual reserve to atomic operations would 
affect small transactions more than large ones. Making all of this 
depend on "wal_level = logical" removes the argument that the two 
solutions are mutually exclusive. It does however make the code less 
maintenance friendly.


Best Regards, Jan




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