pgsql: Flush statistics during idle periods in parallel apply worker.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Flush statistics during idle periods in parallel apply worker.
Date: 2026-04-20 05:07:52
Message-ID: E1wEgrP-001oLj-2D@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Flush statistics during idle periods in parallel apply worker.

Parallel apply workers previously failed to report statistics while
waiting for new work in the main loop. This resulted in the stats from the
most recent transaction remaining unbuffered, leading to arbitrary
reporting delays—particularly when streamed transactions were infrequent.

This commit ensures that statistics are explicitly flushed when the worker
is idle, providing timely visibility into accumulated worker activity.

Author: Zhijie Hou <houzj(dot)fnst(at)fujitsu(dot)com>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Backpatch-through: 16, where it was introduced
Discussion: https://postgr.es/m/TYRPR01MB1419579F217CC4332B615589594202@TYRPR01MB14195.jpnprd01.prod.outlook.com

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d052f6c7d97fae1e5ecee74981fbcbba0f168a7d

Modified Files
--------------
src/backend/replication/logical/applyparallelworker.c | 9 +++++++++
1 file changed, 9 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-04-20 05:13:54 pgsql: Fix incorrect format placeholders
Previous Message Michael Paquier 2026-04-20 03:37:29 pgsql: Meson: Fix check_header() for readline and gssapi