Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion?
Fujii Masao <masao.fujii@gmail.com>
From: Fujii Masao <masao.fujii@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Nisha Moond <nisha.moond412@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>,
shveta malik <shveta.malik@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-04-08T06:54:10Z
Lists: pgsql-hackers
Attachments
- v1-0001-pg17-Fix-ABI-break-by-moving-PROCSIG_SLOTSYNC_MESSAGE-.patch (application/octet-stream) patch v1-0001
- v1-0001-pg18-Fix-ABI-break-by-moving-PROCSIG_SLOTSYNC_MESSAGE-.patch (application/octet-stream) patch v1-0001
On Wed, Apr 8, 2026 at 12:36 PM Fujii Masao <masao.fujii@gmail.com> wrote: > The backpatch added PROCSIG_SLOTSYNC_MESSAGE in the middle of enum > ProcSignalReason, which could break the ABI. I’m planning to move it to > the end of the enum in v17 and v18. > > That seems to work for v18. However, in v17, NUM_PROCSIGNALS is defined > as the last enum value: > > NUM_PROCSIGNALS /* Must be last! */ > } ProcSignalReason; > > So simply moving PROCSIG_SLOTSYNC_MESSAGE to the end would change the meaning > of NUM_PROCSIGNALS. > > One option might be to remove NUM_PROCSIGNALS from the enum, move > PROCSIG_SLOTSYNC_MESSAGE to the end, and define it separately, e.g. > #define NUM_PROCSIGNALS (PROCSIG_SLOTSYNC_MESSAGE + 1). Would that > be acceptable without breaking the ABI? Thoughts? The patches I'm planning to apply for v17 and v18 are attached. For v17, I'm still not entirely sure this change is safe from an ABI perspective. Even if it is, abi-compliance-check may still report a break since the patch removes NUM_PROCSIGNALS from the enum (defines it as separate macro). If so, we may need to update .abi-compliance-history to avoid false positives. Regards, -- Fujii Masao
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Update .abi-compliance-history for change to enum ProcSignalReason
- 29d8bd908560 17.10 landed
-
Fix ABI break by moving PROCSIG_SLOTSYNC_MESSAGE in ProcSignalReason
- 586f4266fb49 17.10 landed
- acf49bfede2a 18.4 landed
-
Fix slotsync worker blocking promotion when stuck in wait
- 15910b1c363f 17.10 landed
- 58c1188a3eaa 18.4 landed
- db93032a7cbd 19 (unreleased) landed
-
Add retry logic to pg_sync_replication_slots().
- 0d2d4a0ec3ec 19 (unreleased) cited
-
Enhance slot synchronization API to respect promotion signal.
- 1362bc33e025 19 (unreleased) cited