Re: BUG #3143: MyLastRecPtr.xlogid not updated with MyLastRecPtr.xrecoff?
От | Heikki Linnakangas |
---|---|
Тема | Re: BUG #3143: MyLastRecPtr.xlogid not updated with MyLastRecPtr.xrecoff? |
Дата | |
Msg-id | 45F55071.2040906@enterprisedb.com обсуждение исходный текст |
Ответ на | BUG #3143: MyLastRecPtr.xlogid not updated with MyLastRecPtr.xrecoff? ("Chongfeng Hu" <loveminix@yahoo.com.cn>) |
Ответы |
Re: BUG #3143: MyLastRecPtr.xlogid not updated with MyLastRecPtr.xrecoff?
|
Список | pgsql-bugs |
Chongfeng Hu wrote: > However, in file src/backend/access/transam/xact.c, on line 1778, I saw the > following code: > > /* Break the chain of back-links in the XLOG records I output */ > MyLastRecPtr.xrecoff = 0; > MyXactMadeXLogEntry = false; > MyXactMadeTempRelUpdate = false; > > It only updated xrecoff, but not xlogid. This might cause serious problems, > because xlogid is still pointing to an old file, while xrecoff is pointing > to a new offset. It might read incorrect records. No, that's actually ok. MyLastRecPtr is used to check if the current transaction has made any transaction-controlled WAL records. If MyLastRecPtr.xrecoff == 0, it hasn't, otherwise it has. All readers of the variable just check for MyLastRecPtr.xrecoff == 0, so the above is OK. I agree that it is a bit misleading, though. A boolean "MyXactMadeTransactionControlledXlogEntry", like the "MyXactMadeXLogEntry" and "MyXactMadeTempRelupdate" variables would be cleaner. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com
В списке pgsql-bugs по дате отправления: