pg_last_xact_replay_timestamp meaning

Started by Bruce Momjianabout 15 years ago4 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

I just applied a doc patch for pg_last_xact_replay_timestamp, and the
text now says:

<entry>Get timestamp of last transaction replayed during recovery.
This is the time at which the commit or abort WAL record for that
transaction was generated on the primary.
If no transactions have been replayed during recovery, this function
returns NULL. Otherwise, if recovery is still in progress this will
increase monotonically. If recovery has completed then this value will
remain static at the value of the last transaction applied during that
recovery. When the server has been started normally without recovery
the function returns NULL.

Is this really the last commit/abort record or the last WAL record?
What should it be? Is the name of this function correct? Do we care
only about commit/abort records? Why?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#2Robert Haas
robertmhaas@gmail.com
In reply to: Bruce Momjian (#1)
Re: pg_last_xact_replay_timestamp meaning

On Fri, Mar 18, 2011 at 7:23 PM, Bruce Momjian <bruce@momjian.us> wrote:

I just applied a doc patch for pg_last_xact_replay_timestamp, and the
text now says:

      <entry>Get timestamp of last transaction replayed during recovery.
       This is the time at which the commit or abort WAL record for that
       transaction was generated on the primary.
       If no transactions have been replayed during recovery, this function
       returns NULL.  Otherwise, if recovery is still in progress this will
       increase monotonically.  If recovery has completed then this value will
       remain static at the value of the last transaction applied during that
       recovery.  When the server has been started normally without recovery
       the function returns NULL.

Is this really the last commit/abort record or the last WAL record?
What should it be?  Is the name of this function correct?  Do we care
only about commit/abort records? Why?

Commit and abort records have a timestamp. Other WAL records don't.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#3Robert Haas
robertmhaas@gmail.com
In reply to: Robert Haas (#2)
Re: pg_last_xact_replay_timestamp meaning

On Fri, Mar 18, 2011 at 9:35 PM, Robert Haas <robertmhaas@gmail.com> wrote:

On Fri, Mar 18, 2011 at 7:23 PM, Bruce Momjian <bruce@momjian.us> wrote:

I just applied a doc patch for pg_last_xact_replay_timestamp, and the
text now says:

      <entry>Get timestamp of last transaction replayed during recovery.
       This is the time at which the commit or abort WAL record for that
       transaction was generated on the primary.
       If no transactions have been replayed during recovery, this function
       returns NULL.  Otherwise, if recovery is still in progress this will
       increase monotonically.  If recovery has completed then this value will
       remain static at the value of the last transaction applied during that
       recovery.  When the server has been started normally without recovery
       the function returns NULL.

Is this really the last commit/abort record or the last WAL record?
What should it be?  Is the name of this function correct?  Do we care
only about commit/abort records? Why?

Commit and abort records have a timestamp.  Other WAL records don't.

Incidentally, there's an open item related to this:

* pg_last_xact_replay_timestamp limitations
linking to http://archives.postgresql.org/message-id/201012071131.55211.gabi.julien@broadsign.com

I'm not sure why this is important enough to be worth being on this
list, but... is this resolved now?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#4Bruce Momjian
bruce@momjian.us
In reply to: Robert Haas (#2)
Re: pg_last_xact_replay_timestamp meaning

Robert Haas wrote:

On Fri, Mar 18, 2011 at 7:23 PM, Bruce Momjian <bruce@momjian.us> wrote:

I just applied a doc patch for pg_last_xact_replay_timestamp, and the
text now says:

? ? ? <entry>Get timestamp of last transaction replayed during recovery.
? ? ? ?This is the time at which the commit or abort WAL record for that
? ? ? ?transaction was generated on the primary.
? ? ? ?If no transactions have been replayed during recovery, this function
? ? ? ?returns NULL. ?Otherwise, if recovery is still in progress this will
? ? ? ?increase monotonically. ?If recovery has completed then this value will
? ? ? ?remain static at the value of the last transaction applied during that
? ? ? ?recovery. ?When the server has been started normally without recovery
? ? ? ?the function returns NULL.

Is this really the last commit/abort record or the last WAL record?
What should it be? ?Is the name of this function correct? ?Do we care
only about commit/abort records? Why?

Commit and abort records have a timestamp. Other WAL records don't.

OK, thanks.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +