Age of the WAL?

Started by Erik Jonesabout 13 years ago5 messagesgeneral
Jump to latest
#1Erik Jones
ejones@engineyard.com

What's the best way to determine the age of the current WAL? Not the current segment, but the whole thing. Put another way: is there a way to determine a timestamp for the oldest available transaction in the WAL?

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Erik Jones (#1)
Re: Age of the WAL?

Erik Jones <ejones@engineyard.com> writes:

What's the best way to determine the age of the current WAL? Not the current segment, but the whole thing. Put another way: is there a way to determine a timestamp for the oldest available transaction in the WAL?

Transaction commit and abort records carry timestamps, so you could
figure this out with something like pg_xlogdump. I don't know of any
canned solution though.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Erik Jones
ejones@engineyard.com
In reply to: Tom Lane (#2)
Re: Age of the WAL?

On Mar 12, 2013, at 4:13 PM, Tom Lane wrote:

Erik Jones <ejones@engineyard.com> writes:

What's the best way to determine the age of the current WAL? Not the current segment, but the whole thing. Put another way: is there a way to determine a timestamp for the oldest available transaction in the WAL?

Transaction commit and abort records carry timestamps, so you could
figure this out with something like pg_xlogdump. I don't know of any
canned solution though.

Tom,

Thanks, and sorry for any discontinuity in the rather long time it's taken for me to get on this reply (had a vacation).

Anyway, will pg_xlogdump work with any previous versions of Postgres or will it be only 9.3+?

For reference, the reason need to be able to do this is this: Given a set of snapshots (each taken with running pg_start_backup before and pg_stop_backup after) and a running server, I need to be able to determine whether or not any given snapshot will be usable for setting up a new standby. I know I could grab the info returned from pg_start_backup and store that as snapshot meta-data but I'm hoping to keep from having to make changes the existing snapshotting code, if possible.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Erik Jones (#3)
Re: Age of the WAL?

Erik Jones <ejones@engineyard.com> writes:

On Mar 12, 2013, at 4:13 PM, Tom Lane wrote:

Transaction commit and abort records carry timestamps, so you could
figure this out with something like pg_xlogdump. I don't know of any
canned solution though.

Anyway, will pg_xlogdump work with any previous versions of Postgres or will it be only 9.3+?

The version recently added to contrib is only meant to work with the
current server release, AFAIK. However, it's derived from older
standalone programs that are out there somewhere --- did you look around
on pgfoundry?

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

In reply to: Tom Lane (#4)
Re: Age of the WAL?

On 26 March 2013 22:21, Tom Lane <tgl@sss.pgh.pa.us> wrote:

The version recently added to contrib is only meant to work with the
current server release, AFAIK. However, it's derived from older
standalone programs that are out there somewhere --- did you look around
on pgfoundry?

Actually, I think the version on pgfoundry is unmainted.

I'd look here instead:

https://github.com/snaga/xlogdump/commits/master

--
Regards,
Peter Geoghegan

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general