Split xlog.c

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Split xlog.c
Дата
Msg-id b3b71061-4919-e882-4857-27e370ab134a@iki.fi
обсуждение исходный текст
Ответы Re: Split xlog.c
Список pgsql-hackers
Hi,

xlog.c is very large. We've split off some functions from it over the 
years, but it's still large and it keeps growing.

Attached is a proposal to split functions related to WAL replay, standby 
mode, fetching files from archive, computing the recovery target and so 
on, to new source file called xlogrecovery.c. That's a fairly clean 
split. StartupXLOG() stays in xlog.c, but much of the code from it has 
been moved to new functions InitWalRecovery(), PerformWalRecovery() and 
EndWalRecovery(). The general idea is that xlog.c is still responsible 
for orchestrating the servers startup, but xlogrecovery.c is responsible 
for figuring out whether WAL recovery is needed, performing it, and 
deciding when it can stop.

There's surely more refactoring we could do. xlog.c has a lot of global 
variables, with similar names but slightly different meanings for 
example. (Quick: what's the difference between InRedo, InRecovery, 
InArchiveRecovery, and RecoveryInProgress()? I have to go check the code 
every time to remind myself). But this patch tries to just move source 
code around for clarity.

There are small changes in the order that some of things are done in 
StartupXLOG(), for readability. I tried to be careful and check that the 
changes are safe, but a second pair of eyes would be appreciated on that.

- Heikki

Вложения

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

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: unnesting multirange data types
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Support for NSS as a libpq TLS backend