Re: Flaky vacuum truncate test in reloptions.sql
Arseny Sher <a.sher@postgrespro.ru>
From: Arseny Sher <a.sher@postgrespro.ru>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-04-04T20:00:25Z
Lists: pgsql-hackers
Attachments
- reloptions_wait_oldestxmin.patch (text/x-diff) patch
On Fri, Apr 2, 2021 at 9:46 AM Michael Paquier <michael@paquier.xyz> wrote: > Okay, applied and back-patched down to 12 then. Thank you both. Unfortunately and surprisingly, the test still fails (perhaps even rarer, once in several hundred runs) under multimaster. After scratching the head for some more time, it seems to me the following happens: not only vacuum encounters locked page, but also there exist a concurrent backend (as the parallel schedule is run) who holds back oldestxmin keeping it less than xid of transaction which did the insertion INSERT INTO reloptions_test VALUES (1, NULL), (NULL, NULL); FreezeLimit can't be higher than oldestxmin, so lazy_check_needs_freeze decides there is nothing to freeze on the page. multimaster commits are quite heavy, which apparently shifts the timings making the issue more likely. Currently we are testing the rather funny attached patch which forces all such old-snapshot-holders to finish. It is crutchy, but I doubt we want to change vacuum logic (e.g. checking tuple liveness in lazy_check_needs_freeze) due to this issue. (it is especially crutchy in xid::bigint casts, but wraparound is hardly expected in regression tests run). -- cheers, arseny
Commits
-
Improve stability of test with vacuum_truncate in reloptions.sql
- bada6280f0b9 12.7 landed
- 89937d001294 13.3 landed
- fe246d1c111d 14.0 landed