RFC: A dead simple implementation of pg_rotate_wal

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема RFC: A dead simple implementation of pg_rotate_wal
Дата
Msg-id 44B91634.9050607@phlo.org
обсуждение исходный текст
Список pgsql-hackers
Hi

I had a urge to do a bit of hacking today, and so I tried to implement 
my idea about an pg_rotate_wal for postgres 8.1. It's basically a huge
hack, and wastes io bandwith - but it doesn't need any patches to 8.1,
and can be compiled as an extension.

Here is the code (Included, because it's so short ;-) ).
#define XLOG_NOP 0x40

Datum pg_rotate_wal(PG_FUNCTION_ARGS) {        void *padding = palloc0(XLOG_SEG_SIZE);        XLogRecData rdata;
        rdata.data = (char*) padding;        rdata.len = XLOG_SEG_SIZE;        rdata.buffer = InvalidBuffer;
rdata.next= NULL;
 
        XLogInsert(RM_XLOG_ID, XLOG_NOP, &rdata) ;
        pfree(padding);        PG_RETURN_NULL() ;
}

Apart from performance (and crazy missuse of the fact that xlog_redo 
just does nothing if it doesn't know the info-flag of the wal record) -
do you think that this is safe to use?

greetings, Florian Pflug


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: More #ifdef fun: src/interfaces/libpq/win32.c
Следующее
От: Tom Lane
Дата:
Сообщение: Still more #ifdef fun: struct sockaddr_storage