Re: AW: AW: AW: WAL-based allocation of XIDs is insecure
От | Tom Lane |
---|---|
Тема | Re: AW: AW: AW: WAL-based allocation of XIDs is insecure |
Дата | |
Msg-id | 6189.983897892@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | AW: AW: AW: WAL-based allocation of XIDs is insecure (Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>) |
Ответы |
Re: AW: AW: AW: WAL-based allocation of XIDs is insecure
|
Список | pgsql-hackers |
Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes: > Is it so hard to swap ? First write page to log then modify in shmem. > Then those pages would have additional value, because > then utilities could do all sorts of things with those pages. After thinking about this a little, I believe I see why Vadim did it the way he did. Suppose we tried to make the code sequence be obtain write lock on buffer;XLogOriginalPage(buffer); // copy page to xlog if first since ckptmodify buffer;XLogInsert(xlogentry for modification);mark buffer dirty and release write lock; so that the saving of the original page is a separate xlog entry from the modification data. Looks easy, and it'd sure simplify XLogInsert a lot. The only problem is it's wrong. What if a checkpoint occurs between the two XLOG records? The decision whether to log the whole buffer has to be atomic with the actual entry of the xlog record. Unless we want to hold the xlog insert lock for the entire time that we're (eg) splitting a btree page, that means we log the buffer after the modification work is done, not before. regards, tom lane
В списке pgsql-hackers по дате отправления: