TODO: machine-readable pg_controldata

Поиск
Список
Период
Сортировка
От Dilip kumar
Тема TODO: machine-readable pg_controldata
Дата
Msg-id 4205E661176A124FAF891E0A6BA913526593A23E@SZXEML507-MBS.china.huawei.com
обсуждение исходный текст
Список pgsql-hackers

Below attached patch is implementing following todo item..

machine-readable pg_controldata?

http://www.postgresql.org/message-id/4B901D73.8030003@agliodbs.com

Possible approaches:

1.       Implement as backend function and provide a view to user.

-          But In this approach user can only get this information when server is running.

 

2.       Extend pg_controldata tool to provide value of an individual attribute.

 

A first draft version of the patch is attached in the mail, implemented using approach 2.

 

Description of the patch:

1.       Below is the list of the option which are exposed by pg_controldata (all checkpoint, redo and backup related options are exposed).

I think we don’t need to expose options for other parameters, because they will not be useful for using independently. (user can simply print all values same as old  behavior)

 

  -v, --catalog-version                                                     catalog version

  -l, --latest-chcekpoint-loc                                           Latest checkpoint location

  -L, --prev-chcekpoint-loc                                            Prior checkpoint location

  -r, --latest-checkpoint-redoloc                                 Latest checkpoint's REDO location

  -t, --latest-checkpoint-timeline                               Latest checkpoint's TimeLineID

  -T, --latest-checkpoint-prevtimeline                     Latest checkpoint's PrevTimeLineID

  -c, --latest-checkpoint-time                                      Time of latest checkpoint

  -x, --latest-checkpoint-nextxid                                Latest checkpoint's NextXID

  -o, --latest-checkpoint-nextoid                               Latest Latest checkpoint's NextOID

  -X, --latest-checkpoint-nextmulti-xactid              Latest checkpoint's NextMultiXactId

  -O, --latest-checkpoint-nextmulti-offset             Latest checkpoint's NextMultiOffset

  -q, --latest-checkpoint-oldestxid                            Latest checkpoint's oldestXID

  -a, --latest-checkpoint-oldest-activexid               Latest checkpoint's oldestActiveXID

  -m, --latest-checkpoint-oldest-multixid               Latest checkpoint's oldestMultiXid

  -e, --min-recovery-endloc                                         Minimum recovery ending location

  -E, --min-recovery-endloc-timeline                       Min recovery ending loc's timeline

  -b, --backup-start-location                                         Backup start location

  -B, --backup-end-location                                          Backup end location

 

2.       If user provide individual option, then direct value of that parameter will be printed (as shown in below example), parameter name is not printed as output so that user need not to parse the output.

 

./pg_controldata --latest-checkpoint-time    -- run with latest-checkpoint-time option

Tue 07 Jan 2014 05:22:42 PM IST  --output is direct value

 

3.       This feature can save parsing effort for user where user need to get the value of individual parameter

i.e Time of latest checkpoint for Standby lag monitoring.

 

Please provide your suggestion…

 

Regards,

Dilip

 

Вложения

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

Предыдущее
От: Dilip kumar
Дата:
Сообщение:
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Get more from indices.