Re: WAL format and API changes (9.5)

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: WAL format and API changes (9.5)
Дата
Msg-id 5469D7C9.2050402@vmware.com
обсуждение исходный текст
Ответ на Re: WAL format and API changes (9.5)  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On 11/14/2014 10:31 AM, Michael Paquier wrote:
> 5) Here why not using the 2nd block instead of the 3rd (@_bt_getroot)?
> +                       XLogBeginInsert();
> +                       XLogRegisterBuffer(0, rootbuf, REGBUF_WILL_INIT);
> +                       XLogRegisterBuffer(2, metabuf, REGBUF_WILL_INIT);

See the comment of the xl_btree_newroot struct. It explains the record 
format of the BTREE_NEWROOT record type:

>  * Backup Blk 0: new root page (2 tuples as payload, if splitting old root)
>  * Backup Blk 1: left child (if splitting an old root)
>  * Backup Blk 2: metapage

When _bt_getroot creates a new root, there is no old root, but the same 
record type is used in _bt_newroot, which uses block ID 1 to refer to 
the old root page.

(Thanks for the comments, again! I'll post a new version soon)

- Heikki




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

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: postgres_fdw behaves oddly
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Review of Refactoring code for sync node detection