Re: [PATCHES] Configuring BLCKSZ and XLOGSEGSZ (in 8.3) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] Configuring BLCKSZ and XLOGSEGSZ (in 8.3)
Date
Msg-id 18043.1165601916@sss.pgh.pa.us
Whole thread Raw
In response to Re: Configuring BLCKSZ and XLOGSEGSZ (in 8.3)  ("Simon Riggs" <simon@2ndquadrant.com>)
Responses Re: [PATCHES] Configuring BLCKSZ and XLOGSEGSZ (in 8.3)  ("Simon Riggs" <simon@2ndquadrant.com>)
List pgsql-hackers
"Simon Riggs" <simon@2ndquadrant.com> writes:
> [ patch to remove logId/logSeg from pg_control ]

Looking this over, I realize that there's an unresolved problem.
Although it's true that xlog.c itself doesn't use the logId/logSeg
fields for anything interesting, pg_resetxlog relies on them to
determine how far the old WAL extends, so that it can determine a
safely higher start address for the new WAL.  This puts a damper
both on my thought of removing the fields altogether, and on Simon's
earlier proposal to update them in shared memory but not immediately
write pg_control during a segment switch.

The proposed patch uses pg_control's last checkpoint location to
drive the end-of-WAL computation, but that is obviously not good
enough, as WAL might have gone many segments beyond that.

Now, underestimating the WAL end address is not fatal; AFAIK the
only consequence would be some complaints about "xlog flush request is
not satisfied" until we had managed to advance the end of WAL past the
largest page LSN present in the data files.  But it's still annoying.

What I'm considering is having pg_resetxlog scan the pg_xlog directory
and assume that any segment files present might have been used.

Thoughts?

            regards, tom lane

pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Load distributed checkpoint
Next
From: Brad Nicholson
Date:
Subject: Re: Load distributed checkpoint