Re: [PATCH v1 0/7] Wait event timing and tracing instrumentation

From: Ilmar Yunusov <tanswis42(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Dmitry Fomin <fomin(dot)list(at)gmail(dot)com>
Subject: Re: [PATCH v1 0/7] Wait event timing and tracing instrumentation
Date: 2026-07-29 10:30:40
Message-ID: 178532104047.575434.9534384751203838349.pgcf@coridan.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While testing v4, I ran into a backend startup failure when
wait_event_capture=stats was set through PGOPTIONS:

FATAL: ResourceOwnerEnlarge called after release started

This was on macOS arm64 with --enable-wait-event-timing,
--enable-cassert and --enable-debug. I ran a one-statement pgbench
workload with two clients (-c 2 -j 2 -t 1) 500 times. 16 runs
returned non-zero, and five runs produced the FATAL above in the
server log.

The failure is probabilistic. The same test did not reproduce with
one client in 500 runs. The two-client tests with
wait_event_capture=off or trace at startup, and with stats or trace set
after connection startup, were also clean.

The relevant part of the backtrace was:

InitPostgres
-> CommitTransactionCommand
-> ProcReleaseLocks
-> LockReleaseAll
-> LWLockAcquire
-> pgstat_report_wait_end_timing
-> pgstat_wait_event_timing_lazy_attach
-> wait_event_timing_attach_array
-> wait_event_timing_ensure_dsa
-> dsa_attach
-> dsm_attach
-> dsm_create_descriptor
-> ResourceOwnerEnlarge

The first lazy DSA attach is reached from the wait-end path while
InitPostgres is already releasing the current resource owner. The
attach path then reaches dsm_create_descriptor(), which calls
ResourceOwnerEnlarge() after release has started.

Could you address this in the next version?

Regards,
Ilmar

The new status of this patch is: Waiting on Author

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Rachitskiy 2026-07-29 10:36:45 Re: Build warning with meson and dtrace on Fedora 43
Previous Message Daniel Gustafsson 2026-07-29 10:28:22 Re: [Patch] Don't stop a `vacuumdb --all` on a connection failure