Re: Concurrency bug in amcheck

Alexander Korotkov <a.korotkov@postgrespro.ru>

From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-04-21T12:31:13Z
Lists: pgsql-hackers
On Tue, Apr 21, 2020 at 12:54 PM Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
> I found concurrency bug in amcheck running on replica.  When
> btree_xlog_unlink_page() replays changes to replica, deleted page is
> left with no items.  But if amcheck steps on such deleted page
> palloc_btree_page() expects it would have items.

I forgot to mention that I've reproduced it on master.  Quick check
shows bug should exist since 11.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



Commits

  1. Remove btree page items after page unlink

  2. Fix amcheck for page checks concurrent to replay of btree page deletion