Re: xlog filename formatting functions in recovery

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: xlog filename formatting functions in recovery
Дата
Msg-id 505C1683.9000808@vmware.com
обсуждение исходный текст
Ответ на Re: xlog filename formatting functions in recovery  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: xlog filename formatting functions in recovery  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On 03.07.2012 15:13, Robert Haas wrote:
> On the substance of the patch, I believe the reason why this is
> currently disallowed is because the TLI is implicitly taken from the
> running system, and on the standby that might be the wrong value.

Yeah, I believe that's the reason. So the question is, what timeline 
should the functions use on a standby? With the patch as it is, they use 0:

postgres=# select pg_xlogfile_name_offset('3/FF020000');      pg_xlogfile_name_offset
----------------------------------- (0000000000000003000000FF,131072)
(1 row)

There's a few different options:

1. current recovery_target_timeline (XLogCtl->recoveryTargetTLI)
2. current ThisTimeLineID, which is bumped every time a timeline-bumping 
checkpoint record is replayed. (this is not currently visible to 
backends, but we could easily add a shared memory variable for it)
3. curFileTLI. That is, the TLI of the current file that we're 
replaying. This is usually the same as ThisTimeLineID, except when 
replaying a WAL segment where the timeline changes
4. Something else?

What do you use these functions for? Which option would make the most sense?

- Heikki



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: [v9.3] Extra Daemons (Re: elegant and effective way for running jobs inside a database)
Следующее
От: Kohei KaiGai
Дата:
Сообщение: Re: 64-bit API for large object