FailedAssertion in heap_index_delete_tuples at heapam.c:7220

Started by Jaime Casanovaalmost 5 years ago3 messages
#1Jaime Casanova
jcasanov@systemguards.com.ec
2 attachment(s)

Hi,

${subject} happened while executing ${attached query} at regresssion
database, using 14dev (commit
d5a83d79c9f9b660a6a5a77afafe146d3c8c6f46) and produced ${attached
stack trace}.

Sadly just loading the regression database and executing this query is
not enough to reproduce. Not sure what else I can do to help with this
one.

--
Jaime Casanova
Director de Servicios Profesionales
SystemGuards - Consultores de PostgreSQL

Attachments:

gdb_crash_heapam.txttext/plain; charset=US-ASCII; name=gdb_crash_heapam.txtDownload
query.sqlapplication/sql; name=query.sqlDownload
In reply to: Jaime Casanova (#1)
Re: FailedAssertion in heap_index_delete_tuples at heapam.c:7220

On Tue, Jan 26, 2021 at 10:52 PM Jaime Casanova
<jcasanov@systemguards.com.ec> wrote:

${subject} happened while executing ${attached query} at regresssion
database, using 14dev (commit
d5a83d79c9f9b660a6a5a77afafe146d3c8c6f46) and produced ${attached
stack trace}.

I see the bug: gistprunepage() calls
index_compute_xid_horizon_for_tuples() (which ultimately calls the
heapam.c callback for heap_index_delete_tuples()) with an empty array,
which we don't expect. The similar code within _hash_vacuum_one_page()
already only calls index_compute_xid_horizon_for_tuples() when
ndeletable > 0.

The fix is obvious: Bring gistprunepage() in line with
_hash_vacuum_one_page(). I'll go push a fix for that now.

Thanks for the report!
--
Peter Geoghegan

#3Jaime Casanova
jcasanov@systemguards.com.ec
In reply to: Peter Geoghegan (#2)
Re: FailedAssertion in heap_index_delete_tuples at heapam.c:7220

On Wed, Jan 27, 2021 at 2:09 AM Peter Geoghegan <pg@bowt.ie> wrote:

On Tue, Jan 26, 2021 at 10:52 PM Jaime Casanova
<jcasanov@systemguards.com.ec> wrote:

${subject} happened while executing ${attached query} at regresssion
database, using 14dev (commit
d5a83d79c9f9b660a6a5a77afafe146d3c8c6f46) and produced ${attached
stack trace}.

I see the bug: gistprunepage() calls
index_compute_xid_horizon_for_tuples() (which ultimately calls the
heapam.c callback for heap_index_delete_tuples()) with an empty array,
which we don't expect. The similar code within _hash_vacuum_one_page()
already only calls index_compute_xid_horizon_for_tuples() when
ndeletable > 0.

The fix is obvious: Bring gistprunepage() in line with
_hash_vacuum_one_page(). I'll go push a fix for that now.

Thanks

--
Jaime Casanova
Director de Servicios Profesionales
SystemGuards - Consultores de PostgreSQL