[PATCH] BUG FIX: inconsistent page found in BRIN_REGULAR_PAGE
Karina Litskevich <litskevichkarina@gmail.com>
From: Karina Litskevich <litskevichkarina@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: 王海洋 <wanghaiyang.001@bytedance.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, pgsql-bugs@lists.postgresql.org
Date: 2022-12-23T13:54:56Z
Lists: pgsql-bugs
Attachments
- v1-0001-prevent-test-from-failing-on-slower-machines.patch (text/x-patch) patch v1-0001
- v2-0001-prevent-test-from-failing-on-slower-machines.patch (text/x-patch) patch v2-0001
Hi Alvaro!
Is there any special reason to read WAL records until the last inserted
record?
+my $end_lsn = $whiskey->lsn('insert');
+
+my ($ret, $out, $err) = $whiskey->psql(
+ 'postgres', qq{
+ select count(*) from pg_get_wal_records_info('$start_lsn', '$end_lsn')
+ where resource_manager = 'BRIN' AND
+ record_type ILIKE '%revmap%'
+ });
+cmp_ok($out, '>=', 1);
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.
I attached two patches with two ways of fixing this minor issue.
Best regards,
Karina Litskevich
Postgres Professional: http://postgrespro.com/
Commits
-
Fix end LSN determination in recently added test
- 6602599ce256 16.0 landed
- 5436cb373c62 15.2 landed
-
BRIN: mask BRIN_EVACUATE_PAGE for WAL consistency checking
- e797c7a6f76b 10.22 landed
- e44dae07f931 16.0 landed
- de31e6f81e84 13.8 landed
- 541f41d4fa78 14.5 landed
- 49b85e4812d7 12.12 landed
- 39e45d3ceca7 11.17 landed
- 2cff3025906c 15.0 landed