Re: Autovacuum endless loop in heap_page_prune()?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Peter <pmc(at)citylink(dot)dinoex(dot)sub(dot)org>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Autovacuum endless loop in heap_page_prune()?
Date: 2024-05-27 11:51:56
Message-ID: edf97a228e17a4702438da969893228b516142c3.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2024-05-27 at 12:48 +0200, Peter wrote:
> On Mon, May 27, 2024 at 11:25:47AM +0200, Laurenz Albe wrote:
> ! On Sat, 2024-05-25 at 12:51 +0200, Peter wrote:
> ! >  I just found Autovacuum run for 6 hours on a 8 GB table, VACUUM query
> ! > doesnt cancel, cluster doesn't stop, autovacuum worker is not
> ! > killable
> !
> ! This smells of index corruption.
> !
> ! I have seen cases where a corrupted index sends VACUUM into an endless loop
> ! so that it does not react to query cancellation.
>
> Thanks for Your reply. So it can happen...

Well, not normally.

> ! Check the index with the "bt_index_check()" function from the "amcheck"
> ! extension. If that reports a problem, rebuild the index.
>
> [runs amcheck test, no problem is reported]
> I don't see a problem there.
>
> After the database did recover, I did manually run VACUUM on the
> respecitve table, it did run successfully in the expected timeframe

Ok...
What made me suspect corruption is that the process could not
be interrupted. Otherwise I'd have assumed that autivacuum was just
running too slowly.

> ! Apart from hardware problems, one frequent cause is upgrading glibc
> ! (if the index on a string column or expression).
>
> No, this is FreeBSD, we don't normally do such things... ;)

You don't update the C library, or collations never change?

> Also, that shouldn't happen with locale 'C', 'SQL_ASCII':

Right.

The C locale is safe (but of course SQL_ASCII is a mistake).

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter 2024-05-27 13:49:38 Re: Autovacuum endless loop in heap_page_prune()?
Previous Message Sašo Gantar 2024-05-27 11:39:54 Re: problem with query