]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Flush statistics during idle periods in parallel apply worker.
authorAmit Kapila <akapila@postgresql.org>
Mon, 20 Apr 2026 04:47:47 +0000 (10:17 +0530)
committerAmit Kapila <akapila@postgresql.org>
Mon, 20 Apr 2026 04:47:47 +0000 (10:17 +0530)
commit88d7fdcc9aaa065daf10ff3b777f607fe65bdc02
treec23377d011cb5fdfd7dda027a86c44301018ab61
parent0d09492a745b9f054c595ea785cbd119d7018b44
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.fnst@fujitsu.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Backpatch-through: 16, where it was introduced
Discussion: https://postgr.es/m/TYRPR01MB1419579F217CC4332B615589594202@TYRPR01MB14195.jpnprd01.prod.outlook.com
src/backend/replication/logical/applyparallelworker.c