Forcing wal rotation

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Forcing wal rotation
Дата
Msg-id 44B7B62F.3050003@phlo.org
обсуждение исходный текст
Ответы Re: Forcing wal rotation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi

For my warm-standby-cluster I'm now saving the currently used wal using rsync,
to avoid loosing data from a few hours (or days) ago, when there is little traffic,
and thus the wal isn't rotated. For online backups, the problem is even worse, because
a backup might me unuseable even hours after I called pg_stop_backup(), because the
wal segment needed to bring the backup to a consistent state might not have been archived
at that time.

I've now thought about how to fix that without doing that rather crude rsync-pg_xlog-hack.
I've read through the code, and learned that wal-segments are expected to have a specific size -
thus rotating them "early" is not that easy. But now I figured that another short-term solution
could probably be implemented easily.

I'd like to write a function that just fills the wal with "nop" records, until the current used
wal is full. Since I assume that there are already different kind of wal records, adding a
NOP-record that just takes up space, and does nothing else, should be quite easy. And even
if wals contain only one kind of record (Write this page to that datafile), I could just
repeat the last records over and over again, until the wal is filled, couldn't I?

Do you think that this is feasable? If so, I'd like to try it.

greetings, Florian Pflug



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ShmemAlloc() alignment patch
Следующее
От: "Marko Kreen"
Дата:
Сообщение: Re: [PATCHES] [patch 0/9] annual pgcrypto update