Streaming replication and pg_xlogfile_name()
От | Fujii Masao |
---|---|
Тема | Streaming replication and pg_xlogfile_name() |
Дата | |
Msg-id | 3f0b79eb1001190135vd9f62f1sa7868abc1ea61d12@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Streaming replication and pg_xlogfile_name()
|
Список | pgsql-hackers |
Hi, In relation to the functions added recently, I found an annoying problem; pg_xlogfile_name(pg_last_xlog_receive/replay_location()) might report the wrong name because pg_xlogfile_name() always uses the current timeline, and a backend doesn't know the actual timeline related to the location which pg_last_xlog_receive/replay_location() reports. Even if a backend knows that, pg_xlogfile_name() would be unable to determine which timeline should be used. To solve this problem, I'm thiking to add the following functions: * pg_current_timeline() reports the current timeline ID. * pg_last_receive_timeline() reports the timeline ID which is related to the last WAL receive location. * pg_last_replay_timeline() reports the timeline ID which is related to the last WAL replay location. * pg_xlogfile_name(location text [, timeline bigint ]) reports the WAL file name using the given timeline. By default, thecurrent timeline is used. * pg_xlogfile_name_offset(location text [, timeline bigint]) reports the WAL file name and offset using the given timeline.By default, the current timeline is used. If the second parameter is omitted, pg_xlogfile_name() would behave as it does now. We can get the right WAL file name by giving it the result of pg_last_receive/replay_timeline(). Thought? Or we should just drop the support of pg_xlogfile_name() for pg_last_xlog_receive/replay_locadtion()? Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center
В списке pgsql-hackers по дате отправления: