Thread: pgsql: Include previous TLI in end-of-recovery and shutdown checkpoint

pgsql: Include previous TLI in end-of-recovery and shutdown checkpoint

From
Heikki Linnakangas
Date:
Include previous TLI in end-of-recovery and shutdown checkpoint records.

This isn't used for anything but a sanity check at the moment, but it could
be highly valuable for debugging purposes. It could also be used to recreate
timeline history by traversing WAL, which seems useful.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7803e9327db3788f68d820c19f4081afb79edd12

Modified Files
--------------
src/backend/access/rmgrdesc/xlogdesc.c  |    7 +++--
src/backend/access/transam/xlog.c       |   36 ++++++++++++++++++++++++++++--
src/bin/pg_controldata/pg_controldata.c |    2 +
src/bin/pg_resetxlog/pg_resetxlog.c     |    4 +++
src/include/access/xlog_internal.h      |    3 +-
src/include/catalog/pg_control.h        |    4 ++-
6 files changed, 48 insertions(+), 8 deletions(-)


Re: pgsql: Include previous TLI in end-of-recovery and shutdown checkpoint

From
Tom Lane
Date:
Heikki Linnakangas <heikki.linnakangas@iki.fi> writes:
> Include previous TLI in end-of-recovery and shutdown checkpoint records.

Hm ... should this patch have included a WAL format version bump
(XLOG_PAGE_MAGIC)?

It may not matter too much, since we already have a different value
from 9.2 there.

            regards, tom lane


Re: pgsql: Include previous TLI in end-of-recovery and shutdown checkpoint

From
Tom Lane
Date:
Heikki Linnakangas <hlinnaka@iki.fi> writes:
> On 11.02.2013 18:28, Tom Lane wrote:
>> Hm ... should this patch have included a WAL format version bump
>> (XLOG_PAGE_MAGIC)?

> I bumped PG_CONTROL_VERSION, that forces an initdb too.

Right, but that data isn't so easily available to WAL-stream consumers.

            regards, tom lane


Re: pgsql: Include previous TLI in end-of-recovery and shutdown checkpoint

From
Heikki Linnakangas
Date:
On 11.02.2013 18:28, Tom Lane wrote:
> Heikki Linnakangas<heikki.linnakangas@iki.fi>  writes:
>> Include previous TLI in end-of-recovery and shutdown checkpoint records.
>
> Hm ... should this patch have included a WAL format version bump
> (XLOG_PAGE_MAGIC)?

I bumped PG_CONTROL_VERSION, that forces an initdb too.

- Heikki