Databases

PostgreSQL autovacuum worker crashes with SIGSEGV on partitioned table after upgrade to 15.2

Environment

Environment

Primary: PostgreSQL 15.2 (Debian 12 package), 256 GB RAM, shared_buffers=32GB, table 'events' partitioned by range (date), largest partition ~400GB, autovacuum enabled cluster-wide with autovacuum_vacuum_scale_factor=0.02, maintenance_work_mem=1GB. Crash observed within 24 hours of upgrade from 14→15 on Ubuntu/Debian test and production hosts.

Symptoms

Symptoms

Autovacuum worker processes abruptly exit with SIGSEGV. Autovacuum logs show 'LOG: automatic vacuum of table

Observations

Observations

postgres logs include 'server process (PID) was terminated by signal 11: Segmentation fault' and a backtrace pointing into 'vacuumlazy.c' and 'heapam.c'; core dump captured. Crashes occur during parallel autovacuum of a large partition; manual VACUUM VERBOSE on the same partition completes without segfault when run interactively. No hardware errors reported; system logs show no OOM or kernel panics. Reproducible on a smaller test cluster when autovacuum_parallel_workers increased and maintenance_work_mem set to higher value.

Already attempted

Already attempted

Set autovacuum to disabled on the largest partition (via ALTER TABLE ... SET (autovacuum_enabled = false)) — crashes stop but autovacuum backlog grows. Enabled more verbose logging (log_min_messages=debug2) and captured backtraces. Rebuilt indexes on affected partition and ran REINDEX. Reproduced in a staging VM using identical table structure and similar workload; core backtrace identical. Rolled back to PostgreSQL 14 binary in staging and autovacuum runs normally. Did not apply any custom extensions beyond pg_stat_statements (enabled).

Question

Question

What is the likely root cause of autovacuum SIGSEGV after the upgrade, and what safe remediation paths let me restore autovacuum without data loss? Should I disable autovacuum on partitions selectively, backport a patch, or change configuration to avoid the crash?

COMMUNITY RESPONSES

Verified community troubleshooting

0 replies

No answers yet..

Showing 0 of 0 community responses
AI DIAGNOSTICS

Incident analysis

Updated 1mo ago• Trouble ID

Most likely causes

Regression in PostgreSQL 15.2 autovacuum/parallel vacuum code path when handling large partitioned tables causing heap access out-of-bounds (software bug in vacuumlazy.c) 80%
Incompatible binary/extension built against older server version (extension ABI mismatch) leading to unexpected behavior in autovacuum worker processes 35%
Memory corruption from third-party extension or background process (unlikely since only autovacuum triggers it and backtrace points into core VACUUM code) 20%

Summary

SIGSEGV in autovacuum during lazy vacuum indicates a bug triggered by specific code paths in the newer PostgreSQL engine: possibly regression in VACUUM related to parallel/autovacuum logic, interactions with partitioned tables, or an extension mismatch. The fact that manual VACUUM runs fine and the issue reproduces across machines points towards a PostgreSQL code regression rather than hardware corruption. Differences between autovacuum worker configuration (parallel workers, maintenance memory) and manual runs (single-process with different resource limits) suggest the crash surfaces only under autovacuum concurrency or memory usage.

Suggested Fixes

Diagnostic step 1
Temporarily disable autovacuum on the specific partition(s) that crash (ALTER TABLE ... SET (autovacuum_enabled = false)) to stop segfaults; schedule manual VACUUM runs during maintenance windows to control load — this is reversible and prevents further crashes until a software fix is available.
Diagnostic step 2
Reproduce the crash on an isolated staging host with the same PostgreSQL build and configuration and collect full core dumps, server log, and pg_dump of schema (avoid exporting production data unnecessarily). Provide these artifacts to the PostgreSQL mailing list or vendor support rather than public forums (avoid sharing PII).
Diagnostic step 3
Check installed extensions with SELECT * FROM pg_extension; ensure none are built for a different major version. If any extension binary was not upgraded with the server, rebuild/reinstall the extension against the new server version.

Continue troubleshooting

Matched from the title, description and tags