Re: Fsync (flush) all inserted WAL records

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: Fsync (flush) all inserted WAL records
Дата
Msg-id CAJ7c6TNe_UeXwv0BbTxOEyhQXLA-g4qAcVCpV=GSuTHVSXswfA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fsync (flush) all inserted WAL records  ("Vitaly Davydov" <v.davydov@postgrespro.ru>)
Ответы Re: Fsync (flush) all inserted WAL records
Список pgsql-hackers
Hi Vitaly,

> I would propose a new function to fulfill my requirements like this (see below) but I prefer not to create new
functionsunreasonably:
 
>
> XLogRecPtr
> GetXLogLastInsertEndRecPtr(void)
> {
>     XLogCtlInsert *Insert = &XLogCtl->Insert;
>     uint64 current_bytepos;
>     SpinLockAcquire(&Insert->insertpos_lck);
>     current_bytepos = Insert->CurrBytePos;
>     SpinLockRelease(&Insert->insertpos_lck);
>     return XLogBytePosToEndRecPtr(current_bytepos);
> }
>
> This function differs from the existing GetXLogInsertRecPtr() by calling XLogBytePosToEndRecPtr instead of
XLogBytePosToRecPtr.

Perhaps you could give more context on the use cases for this
function? The value of it is not quite clear. What people typically
need is making sure if a given LSN was fsync'ed and/or replicated
and/or applied on a replica. Your case(s) however is different and I
don't fully understand it.

In any case you will need to implement an SQL-wrapper in order to make
the function available to DBAs, cover it with tests and provide
documentation.

-- 
Best regards,
Aleksander Alekseev



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