Re: During Xlog replaying, is there maybe emitted xlog?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "xu2002261" <xu2002261(at)163(dot)com>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: During Xlog replaying, is there maybe emitted xlog?
Date: 2012-07-18 02:05:19
Message-ID: 13579.1342577119@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"xu2002261" <xu2002261(at)163(dot)com> writes:
> Hi all,
> I reviewed the source code, and saw the following calling path:

> StartupXLOG() > StartupDatabase() > RmgrTable[rmid].rm_cleanup() > btree_xlog_cleanup() > _bt_insert_parent > _bt_insertonpg() > XLogInsert()

> As we can see, during xlog replaying, XLog may be emitted. So whether there are some *ISSUE* in above calling stack?

No, it's entirely correct. That path isn't "during" replay, it's upon
completion of replay, where we're cleaning up anything that failed to be
completed before the crash. Emitting more WAL is allowed then. Note
the comment a few lines above the rm_cleanup calls:

/*
* Resource managers might need to write WAL records, eg, to record
* index cleanup actions. So temporarily enable XLogInsertAllowed in
* this process only.
*/

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message xu2002261 2012-07-18 02:16:35 Re: During Xlog replaying, is there maybe emitted xlog?
Previous Message xu2002261 2012-07-18 01:29:51 During Xlog replaying, is there maybe emitted xlog?