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 <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Amit Kapila <[email protected]>
Backpatch-through: 16, where it was introduced
Discussion: 
https://postgr.es/m/tyrpr01mb1419579f217cc4332b615589594...@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(+)

Reply via email to