Fix stats reporting delays in logical parallel apply worker
Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>
From: "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-04-17T03:01:08Z
Lists: pgsql-hackers
Attachments
- v1-0002-Test-the-stats-report-in-parallel-apply-worker.patch (application/octet-stream) patch v1-0002
- v1-0001-Fix-stats-reporting-delays-in-parallel-apply-work.patch (application/octet-stream) patch v1-0001
Hi, When implementing another feature, I noticed that parallel apply workers currently do not report statistics while idle in their main loop. This can cause stats from the last processed transaction to be arbitrarily delayed, especially when there are long gaps between streamed transactions. The issue is demonstrated in 0002, where a TAP test fails when attempting to collect stats from a parallel apply worker that has no subsequent transaction to trigger a stats report. 0001 fixes this issue by forcing a stats report when the worker is idle in the main loop, matching the behavior already present in LogicalRepApplyLoop() for regular logical apply workers. Best Regards, Hou zj
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Flush statistics during idle periods in parallel apply worker.
- 090c4297e409 19 (unreleased) landed
- 44c8dc280178 18.4 landed
- 88d7fdcc9aaa 17.10 landed
- d052f6c7d97f 16.14 landed