]> 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:53:22 +0000 (10:23 +0530)
committerAmit Kapila <akapila@postgresql.org>
Mon, 20 Apr 2026 04:53:22 +0000 (10:23 +0530)
commit44c8dc28017800892adbdc7f248f6bed5aa90bef
tree57095168178381bf17784defb6cb40a09cbacd3e
parent7a8c4344f749418ec8d7f4d51a6073696526217e
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