Re: [PATCH] BUG FIX: inconsistent page found in BRIN_REGULAR_PAGE - Mailing list pgsql-bugs

From Patrick Headley
Subject Re: [PATCH] BUG FIX: inconsistent page found in BRIN_REGULAR_PAGE
Date
Msg-id eed10960-feb6-ae7f-52be-ff1b237fd60b@linxco-inc.com
Whole thread Raw
In response to Re: [PATCH] BUG FIX: inconsistent page found in BRIN_REGULAR_PAGE  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-bugs

Evelyn,

I ran the query that runs when you click on Check Invoices  that returns the invTotal and TotDetailAmt and here's what came up. As you will see, the invTotal amounts from your list don't match the production data and most of the amounts in TotDetailAmt don't match production data. Where did your list come from? Is this an old list from the other day?

I have turned on the invTotal field in both invoice forms so you can compare the Total Invoice amount that is calculated from the line items with the invTotal amount that is saved to the database. This will allow you to see what is being saved at the time of creating the invoice.

Patrick Headley
Linx Consulting, Inc.
(303) 916-5522
pheadley@linxco-inc.com
www.linxco-inc.com


On 12/23/22 9:35 AM, Alvaro Herrera wrote:
Hello,

On 2022-Dec-23, Karina Litskevich wrote:

Is there any special reason to read WAL records until the last inserted
record?
Hmm, no, there's no good reason to do it that way.

It seems that in some rare situations on slower machines this test can fail.
If any background process inserts a WAL record before lsn('insert')
and this record isn't flushed before
pg_get_wal_records_info('$start_lsn', '$end_lsn'),
pg_get_wal_records_info('$start_lsn', '$end_lsn') ends with ERROR
"cannot accept future end LSN" as it works only if record with end LSN
is inserted.
Hmm.  I've never seen that, but it sounds plausible.

I attached two patches with two ways of fixing this minor issue.
-my $end_lsn = $whiskey->lsn('insert');
+my $end_lsn = $whiskey->lsn('flush');
Thank you, I used this one.

Regards

Attachment

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17730: Trigger Issue
Next
From: Tom Lane
Date:
Subject: Re: BUG #17730: Trigger Issue