Questions related to xlog

Поиск
Список
Период
Сортировка
От Qingqing Zhou
Тема Questions related to xlog
Дата
Msg-id Pine.LNX.4.58.0512231534300.22064@eon.cs
обсуждение исходный текст
Ответы Re: Questions related to xlog  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I have several questions in understanding xlog code:

(1)
In RecordTransactionCommit():
* (If it made no transaction-controlled XLOG entries, its XID appears* nowhere in permanent storage

We have this in XLogInsert():
/* Insert record header */record->xl_xid = GetCurrentTransactionIdIfAny();

So in some situations (i.e., this transaction was already assigned an
XID), XLOG_NO_TRAN entries' XID does show up in permante storage?

(2)
In smgrcreate():
 * Make a non-transactional XLOG entry showing the file creation.  It's * non-transactional because we should replay it
whetherthe transaction * commits or not
 
lsn = XLogInsert(... XLOG_NO_TRAN ...);

Do we replay *all* xlogs no matter it commits or not? AFAICS, the only
usage of marking xlog non transaction-controlled is not to move
MyLastRecPtr pointer (so possiblly reduce some work at transaction
prepare/commit/abort point), and other usage?

(3)
Also in smgrcreate():
*  ...; the WAL sequence will tell whether to drop the file.*/
void
smgrcreate(SMgrRelation reln, bool isTemp, bool isRedo)

Seems nobody is reponsible to remove the smgrcreate()'d file if only
XLOG_SMGR_CREATE entry is flushed and system crash?

Regards,
Qingqing





В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: where is the output
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Oracle PL/SQL Anonymous block equivalent in postgres