Re: XLogReadBufferExtended() vs disconnected segments

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: XLogReadBufferExtended() vs disconnected segments
Дата
Msg-id 20230223011228.3grh4sebgwtw2hln@awork3.anarazel.de
обсуждение исходный текст
Ответ на XLogReadBufferExtended() vs disconnected segments  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi,

On 2023-02-22 17:01:47 -0800, Andres Freund wrote:
> One way to to defend against this would be to make mdextend(), whenever it
> extends into the last block of a segment, unlink the next segment - it can't
> be a validly existing contents.  But it seems scary to just unlink entire
> segments.

Another way might be for XLOG_SMGR_TRUNCATE record, as well as smgr unlinks in
commit/abort records, to include not just the "target size", as we do today,
but to also include the current size.

I'm not sure that'd fix all potential issues, but it seems like it'd fix a lot
of the more obvious issues, because it'd prevent scenarios like a base backup
copying segment N, without copying N - 1, due to a concurrent truncate/drop,
from causing harm. Due to the range being included in the WAL record, replay
would know that N needs to be unlinked, even if smgrnblocks() thinks the
relation is much smaller.

Greetings,

Andres Freund



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: XLogReadBufferExtended() vs disconnected segments
Следующее
От: Peter Smith
Дата:
Сообщение: Re: Time delayed LR (WAS Re: logical replication restrictions)