pgsql: Allow pg_resetxlog -f to reset pg_control counters using xlog

Started by Bruce Momjianover 20 years ago3 messagescomitters
Jump to latest
#1Bruce Momjian
bruce@momjian.us

Log Message:
-----------
Allow pg_resetxlog -f to reset pg_control counters using xlog
information, and add a -r option to reset pg_control without affecting
xlog.

yuanjia lee

Modified Files:
--------------
pgsql/doc/src/sgml/ref:
pg_resetxlog.sgml (r1.13 -> r1.14)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/pg_resetxlog.sgml.diff?r1=1.13&r2=1.14)
pgsql/src/bin/pg_resetxlog:
pg_resetxlog.c (r1.43 -> r1.44)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_resetxlog/pg_resetxlog.c.diff?r1=1.43&r2=1.44)

#2Simon Riggs
simon@2ndQuadrant.com
In reply to: Bruce Momjian (#1)
Re: pgsql: Allow pg_resetxlog -f to reset pg_control

It appears to me that a line like this has been missed out for when
mode==GUESS

ControlFile.checkPointCopy.ThisTimeLineID = 2;

(search for 514...)

The old line which guessed at
ControlFile.checkPointCopy.ThisTimeLineID = 1;
has been removed, but with nothing to replace it, except in WAL mode.

I'd prefer to guess the TLI as 2, since that is usually one more than
where we got to previously, and much more likely to be a reasonable
value choice.

On Tue, 2006-04-25 at 23:17 -0300, Bruce Momjian wrote:

Log Message:
-----------
Allow pg_resetxlog -f to reset pg_control counters using xlog
information, and add a -r option to reset pg_control without affecting
xlog.

pgsql/src/bin/pg_resetxlog:
pg_resetxlog.c (r1.43 -> r1.44)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_resetxlog/pg_resetxlog.c.diff?r1=1.43&r2=1.44)

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com/

#3Bruce Momjian
bruce@momjian.us
In reply to: Simon Riggs (#2)
Re: pgsql: Allow pg_resetxlog -f to reset pg_control

Simon Riggs wrote:

It appears to me that a line like this has been missed out for when
mode==GUESS

ControlFile.checkPointCopy.ThisTimeLineID = 2;

(search for 514...)

The old line which guessed at
ControlFile.checkPointCopy.ThisTimeLineID = 1;
has been removed, but with nothing to replace it, except in WAL mode.

I'd prefer to guess the TLI as 2, since that is usually one more than
where we got to previously, and much more likely to be a reasonable
value choice.

Good analysis. I cleaned up that section and added the line you
suggested.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachments:

/bjm/difftext/plainDownload+24-20