Is there a way (except from server logs) to know the kind of on-going/last checkpoint?

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Is there a way (except from server logs) to know the kind of on-going/last checkpoint?
Дата
Msg-id CALj2ACUSED8QQWDHZ6yPusH7p7VecQ0pNm5Oin7WwdxkyhhUWg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Is there a way (except from server logs) to know the kind of on-going/last checkpoint?  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Re: Is there a way (except from server logs) to know the kind of on-going/last checkpoint?  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi,

Currently one can know the kind of on-going/last checkpoint (shutdown,
end-of-recovery, immediate, force etc.) only via server logs that to
when log_checkpoints GUC is on. At times, the users/service layer
components would want to know the kind of checkpoint (along with other
checkpoint related info) to take some actions and it will be a bit
difficult to search through the server logs. The checkpoint info can
be obtained from the control file (either by pg_control_checkpoint()
or by pg_controldata tool) whereas checkpoint kind isn't available
there.

How about we add an extra string field to the control file alongside
the other checkpoint info it already has? This way, the existing
pg_control_checkpoint() or pg_controldata tool can easily be enhanced
to show the checkpoint kind as well. One concern is that we don't want
to increase the size of pg_controldata by more than the typical block
size (of 8K) to avoid any torn-writes. With this change, we might add
at max the strings specified at [1]. Adding it to the control file has
an advantage of preserving the last checkpoint kind which might be
useful.

Thoughts?

[1] for checkpoint: "checkpoint shutdown end-of-recovery immediate
force wait wal time flush-all"
for restartpoint: "restartpoint shutdown end-of-recovery immediate
force wait wal time flush-all"

Regards,
Bharath Rupireddy.



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

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: should we document an example to set multiple libraries in shared_preload_libraries?
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: logical decoding and replication of sequences