Re: BUG #16760: Standby database missed records for at least 1 table - Mailing list pgsql-bugs

From Euler Taveira
Subject Re: BUG #16760: Standby database missed records for at least 1 table
Date
Msg-id CAH503wAfiC+OD-_0-fYiKjuxGj6uxXZCVt5Do88tTbM0TBk=ZQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #16760: Standby database missed records for at least 1 table  (Andriy Bartash <abartash@xmatters.com>)
Responses Re: BUG #16760: Standby database missed records for at least 1 table
List pgsql-bugs
On Tue, 8 Dec 2020 at 21:03, Andriy Bartash <abartash@xmatters.com> wrote:

Hi Euler

I inspected pages where I expected to have my data on broken standby.

What was done:

  1. Identified the page where was my data (on primary cluster)

select ctid,audit_ev_id from audit_evs_all  where audit_ev_id between 221535154 and 221535162;

and it returned

ctid,audit_ev_id

"(1979,3)",221535154

"(1980,13)",221535155

"(1980,14)",221535156

"(1980,28)",221535157

"(1980,29)",221535158

"(1982,6)",221535159

"(1982,7)",221535160

"(1982,32)",221535161

"(1982,33)",221535162

Found that page # 1982 had 4 records on primary (ev_id 221535159, 221535160, 221535161 and 221535162)

If you already have the broken secondary, share the following query results from both servers (requires extension pageinspect):

SELECT lp, lp_off, lp_flags, lp_len, t_xmin, t_xmax, t_field3, t_ctid, to_hex(t_infomask) AS infomask, to_hex(t_infomask2) AS infomask2, t_hoff, t_bits FROM heap_page_items(get_raw_page('audit_evs_all', 1982)) WHERE t_ctid IN('1982,6)', '(1982,7)', '(1982,32)');


--
Euler Taveira                 http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #16768: PostgreSQL 12.5 - INSERT ON CONFLICT succeeds on data INSERT but does nothing on UPDATE
Next
From: Andriy Bartash
Date:
Subject: Re: BUG #16760: Standby database missed records for at least 1 table