Re: WAL consistency check facility - Mailing list pgsql-hackers

From Kuntal Ghosh
Subject Re: WAL consistency check facility
Date
Msg-id CAGz5QCKwvDzRBhSG2oQ04Ly+9uwre2T5Z=3ODo=nGctUxKf3-Q@mail.gmail.com
Whole thread Raw
In response to Re: WAL consistency check facility  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: WAL consistency check facility  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Thanks a lot.

I just want to mention the situation where I was getting the
speculative token related inconsistency.

ItemPointer in backup page from master:
LOG:  ItemPointer BlockNumber: 1 OffsetNumber:65534 Speculative: true
CONTEXT:  xlog redo at 0/127F4A48 for Heap/INSERT+INIT: off 1

ItemPointer in current page from slave after redo:
LOG:  ItemPointer BlockNumber: 0 OffsetNumber:1 Speculative: false
CONTEXT:  xlog redo at 0/127F4A48 for Heap/INSERT+INIT: off 1

As the block numbers are different, I was getting the following warning:
WARNING:  Inconsistent page (at byte 8166) found for record
0/127F4A48, rel 1663/16384/16946, forknum 0, blkno 0, Backup Page
Header : (pd_lower: 28 pd_upper: 8152 pd_special: 8192) Current Page
Header: (pd_lower: 28 pd_upper: 8152 pd_special: 8192)
CONTEXT:  xlog redo at 0/127F4A48 for Heap/INSERT+INIT: off 1

In heap_xlog_insert, t_ctid is always set to blkno and xlrec->offnum.
I think this is why I was getting the above warning.


On Thu, Aug 25, 2016 at 10:33 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Kuntal Ghosh wrote:
>
>> 4. For Speculative Heap tuple insert operation, there was
>> inconsistency in t_ctid value. So, I've modified the t_ctid value (in
>> backup page) to current block number and offset number. Need
>> suggestions!!
>
> In speculative insertions, t_ctid is used to store the speculative
> token.  I think you should just mask that field out in that case (which
> you can recognize because ip_posid is set to magic value 0xfffe).
>
> --
> Álvaro Herrera                http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



--
Thanks & Regards,
Kuntal Ghosh



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Transactions involving multiple postgres foreign servers
Next
From: Venkata B Nagothi
Date:
Subject: Re: patch proposal