Re: GIN needs tonic

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: GIN needs tonic
Дата
Msg-id 4AAF3734.5030406@enterprisedb.com
обсуждение исходный текст
Ответ на GIN needs tonic  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: GIN needs tonic  (Simon Riggs <simon@2ndQuadrant.com>)
Re: GIN needs tonic  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Simon Riggs wrote:
> In recovery of GIN operations using CVS HEAD I see consistently
>
> TRAP: FailedAssertion("!(((bool) ((spcNode) != ((Oid) 0))))", File:
> "tablespace.c", Line: 116)
>
> Looking at code, "new list page" WAL record is a GIN record type and at
> line 115 in gin/ginfast.c I see that the value of the node is unset.
> That means XLOG_GIN_INSERT_LISTPAGE always has specNode == 0 and so
> triggers the assertion failure.

Yeah, so it seems. The fix should be as simple as:

--- a/src/backend/access/gin/ginfast.c
+++ b/src/backend/access/gin/ginfast.c
@@ -121,6 +121,7 @@ writeListPage(Relation index, Buffer buffer,
         rdata[1].len = size;
         rdata[1].next = NULL;

+        data.node = index->rd_node;
         data.blkno = BufferGetBlockNumber(buffer);
         data.rightlink = rightlink;
         data.ntuples = ntuples;


This means that the WAL replay of that record type has never been tested
correctly :-(. Looking closer at writeListPage(), why does it always
include 'workspace' in the WAL record, even if a full-page-image is
taken? It's not used for anything the the redo function. That's
harmless, but bloats the WAL record unnecessary. In fact it might be
better to never do full-page writes for that record type, since it
completely overwrites the page anyway.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: BUG #5055: Invalid page header error
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: GIN needs tonic