Help with finding checkpoint code

Lists: pgsql-hackers
From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Help with finding checkpoint code
Date: 2002-09-01 03:27:08
Message-ID: 200209010327.g813R8x07728@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I am trying to find when WAL log files are rotated. The message is:

2002-02-11 21:18:13 DEBUG: recycled transaction log file 0000000000000005

and it is printed in MoveOfflineLogs(), and MoveOfflineLogs() is only
called by CreateCheckPoint(), but I can't see where CreateCheckPoint()
is called in normal operation. I see it called by CHECKPOINT, and on
startup and shutdown, and from bootstrap, but where is it called during
normal backend operation.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Help with finding checkpoint code
Date: 2002-09-01 03:51:04
Message-ID: 20020831235104.0bc80f1d.alvherre@atentus.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

En Sat, 31 Aug 2002 23:27:08 -0400 (EDT)
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> escribió:

> I am trying to find when WAL log files are rotated. The message is:
>
> 2002-02-11 21:18:13 DEBUG: recycled transaction log file 0000000000000005
>
> and it is printed in MoveOfflineLogs(), and MoveOfflineLogs() is only
> called by CreateCheckPoint(), but I can't see where CreateCheckPoint()
> is called in normal operation. I see it called by CHECKPOINT, and on
> startup and shutdown, and from bootstrap, but where is it called during
> normal backend operation.

I see it on TruncateCLOG(), src/backend/access/transam/clog.c; that is
called by vacuum code. Also on CheckPoinDataBase(), macro in
src/backend/postmaster/postmaster.c (this is called on a periodic basis
AFAIU)

HTH

--
Alvaro Herrera (<alvherre[a]atentus.com>)
One man's impedance mismatch is another man's layer of abstraction.
(Lincoln Yeoh)


From: "J(dot) R(dot) Nield" <jrnield(at)usol(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Help with finding checkpoint code
Date: 2002-09-01 03:56:12
Message-ID: 1030852579.13094.232.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

It is called by a special child process of the postmaster after a
signal. Search for PMSIGNAL_DO_CHECKPOINT in xlog.c and in postmaster.c.
The checkpoint process gets started out of sigusr1_handler().

On Sat, 2002-08-31 at 23:27, Bruce Momjian wrote:
> I am trying to find when WAL log files are rotated. The message is:
>
> 2002-02-11 21:18:13 DEBUG: recycled transaction log file 0000000000000005
>
> and it is printed in MoveOfflineLogs(), and MoveOfflineLogs() is only
> called by CreateCheckPoint(), but I can't see where CreateCheckPoint()
> is called in normal operation. I see it called by CHECKPOINT, and on
> startup and shutdown, and from bootstrap, but where is it called during
> normal backend operation.
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania 19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
--
J. R. Nield
jrnield(at)usol(dot)com


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "J(dot) R(dot) Nield" <jrnield(at)usol(dot)com>
Cc: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Help with finding checkpoint code
Date: 2002-09-01 22:36:25
Message-ID: 200209012236.g81MaPF26080@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Thanks, got it.

---------------------------------------------------------------------------

J. R. Nield wrote:
> It is called by a special child process of the postmaster after a
> signal. Search for PMSIGNAL_DO_CHECKPOINT in xlog.c and in postmaster.c.
> The checkpoint process gets started out of sigusr1_handler().
>
>
> On Sat, 2002-08-31 at 23:27, Bruce Momjian wrote:
> > I am trying to find when WAL log files are rotated. The message is:
> >
> > 2002-02-11 21:18:13 DEBUG: recycled transaction log file 0000000000000005
> >
> > and it is printed in MoveOfflineLogs(), and MoveOfflineLogs() is only
> > called by CreateCheckPoint(), but I can't see where CreateCheckPoint()
> > is called in normal operation. I see it called by CHECKPOINT, and on
> > startup and shutdown, and from bootstrap, but where is it called during
> > normal backend operation.
> >
> > --
> > Bruce Momjian | http://candle.pha.pa.us
> > pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> > + If your life is a hard drive, | 13 Roberts Road
> > + Christ can be your backup. | Newtown Square, Pennsylvania 19073
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> > (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
> >
> --
> J. R. Nield
> jrnield(at)usol(dot)com
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073