Assert("vacrel->eager_scan_remaining_successes > 0")

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Assert("vacrel->eager_scan_remaining_successes > 0")
Date: 2025-05-02 18:59:59
Message-ID: CAD21AoConf6tkVCv-=JhQJj56kYsDwo4jG5+WqgT+ukSkYomSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I hit the assertion failure in the subject line with the following script:

create table t (a int) with (autovacuum_enabled = off);
insert into t select generate_series(1, 1_000_000);
vacuum t;
insert into t select generate_series(1, 1_000_000);
set vacuum_freeze_min_age to 0;
vacuum t;

When the success count reaches to 0, we disable the eager scan by
resetting related fields as follows:

/*
* If we hit our success cap, permanently disable eager
* scanning by setting the other eager scan management
* fields to their disabled values.
*/
vacrel->eager_scan_remaining_fails = 0;
vacrel->next_eager_scan_region_start = InvalidBlockNumber;
vacrel->eager_scan_max_fails_per_region = 0;

However, there is a possibility that we have already eagerly scanned
another page and returned it to the read stream before we freeze the
eagerly-scanned page and disable the eager scan. In this case, the
next block that we retrieved from the read stream could also be an
eagerly-scanned page.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2025-05-02 19:04:22 Re: Adding skip scan (including MDAM style range skip scan) to nbtree
Previous Message Jacob Champion 2025-05-02 18:56:46 Re: [PoC] Federated Authn/z with OAUTHBEARER