Re: collect_corrupt_items_vacuum.patch - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: collect_corrupt_items_vacuum.patch
Date
Msg-id CAPpHfdscrsKdw12Xi8zgkmUCYuL3RCXAJF-a_pK0-QZ=1hQq2w@mail.gmail.com
Whole thread Raw
In response to Re: collect_corrupt_items_vacuum.patch  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: collect_corrupt_items_vacuum.patch
List pgsql-hackers
On Tue, Aug 13, 2024 at 9:39 PM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>
> This causes an assertion failure when executed in a hot standby server:
>
>   select * from pg_check_visible('pg_database');
>
> TRAP: failed Assert("!RecoveryInProgress()"), File:
> "../src/backend/storage/ipc/procarray.c", Line: 2710, PID: 1142572
>
> GetStrictOldestNonRemovableTransactionId does this:
>
> >       if (rel == NULL || rel->rd_rel->relisshared || RecoveryInProgress())
> >       {
> >               /* Shared relation: take into account all running xids */
> >               runningTransactions = GetRunningTransactionData();
> >               LWLockRelease(ProcArrayLock);
> >               LWLockRelease(XidGenLock);
> >               return runningTransactions->oldestRunningXid;
> >       }
>
> And GetRunningTransactionData() has this:
>
> >       Assert(!RecoveryInProgress());
>
> So it's easy to see that you will hit that assertion.

Oh, thank you!
I'll fix this and add a test for recovery!

------
Regards,
Alexander Korotkov
Supabase



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Apply PGDLLIMPORT markings to some GUC variables
Next
From: Dmitry Dolgov
Date:
Subject: Re: pg_stat_statements and "IN" conditions