public inbox for [email protected]  
help / color / mirror / Atom feed
From: Fujii Masao <[email protected]>
To: Amit Kapila <[email protected]>
Cc: Nisha Moond <[email protected]>
Cc: Zhijie Hou (Fujitsu) <[email protected]>
Cc: shveta malik <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion?
Date: Wed, 8 Apr 2026 15:54:10 +0900
Message-ID: <CAHGQGwF7QvpRZL6sT3m5EeuacL4SePqmMu1+zJiJc3V2u-tBOA@mail.gmail.com> (raw)
In-Reply-To: <CAHGQGwH_AAbtsiYDJt65N7_4PJ0CgOJmBEaCq68e5_tcuG_vXw@mail.gmail.com>
References: <CAHGQGwFzNYroAxSoyJhqTU-pH=t4Ej6RyvhVmBZ91Exj_TPMMQ@mail.gmail.com>
	<CAA4eK1+CrQNqiPDKv1wYfdkbX0FARJoi1=0ioaAqkLzbq2vG1w@mail.gmail.com>
	<CAHGQGwHABvuCoyM24HUiFZ5oJq_CoFomjt_cqD-0cJLMjFXJjQ@mail.gmail.com>
	<CAA4eK1LzZGfRANPAnv6NpKCH2ENuZO6HswgY14A=xsOXmucPhw@mail.gmail.com>
	<CABdArM6nepct0uxizCnZqy-kAjjTOndvu7bWtaNcmknuxx82Hg@mail.gmail.com>
	<CAJpy0uBhJB4HqouLXegD=miSkZfZp86tTC2K0K6nf=bHCcsPLQ@mail.gmail.com>
	<CABdArM6Mfhk2+9TVR_D3cgfPWPfHDuZEg7MOc5KqULwt0OcQUg@mail.gmail.com>
	<CAA4eK1+d2vN80-Yvy_Hr=ATF3XL5db+_W-sXF=2Vxm+OFBO82w@mail.gmail.com>
	<CAA4eK1KxU4b53GUor41A55x+Bx-DdOaQ9g1DqURyRY2Cg-hhPQ@mail.gmail.com>
	<CABdArM6pmn5yFqiU33KTYBXYM=Vny2ULnJY_gqFbsMEdt+1dPA@mail.gmail.com>
	<CAHGQGwEsEjXbCthXb02=HScBW7C=BHmygv9SK1VGCcc-9bmTsw@mail.gmail.com>
	<CABdArM5rrhSmFvVL4C5LL0iea-R0HRtB=ZvD=ereoTDa1Tm=NA@mail.gmail.com>
	<CAJpy0uD5brcAOpM8+UGfpzrm4pu-vsSfQUT2zgmcKsXEb8++4Q@mail.gmail.com>
	<CABdArM6E2aBj0FUjr2870sZUQqc6mpV1xSM=sqUFd2tKbfUQHA@mail.gmail.com>
	<TY4PR01MB16907318494FF276465E97DF79453A@TY4PR01MB16907.jpnprd01.prod.outlook.com>
	<CABdArM5RqLna+Y3CF=0BKew-WyxoAKXgcaOnXG1DZpMEiogCqw@mail.gmail.com>
	<CAHGQGwF1=zu478YX1kNaX+qaNp9DH_p+5ZdSfFdTa=JuynJufQ@mail.gmail.com>
	<CABdArM7OsLhyactNNUZ+Wygc_ybv4hhgje9c+h+=PHm3QdS4iQ@mail.gmail.com>
	<CAHGQGwHndKa--mCKAaSpAtdTte_3RJkUueZcDSqdUASqTsDK0Q@mail.gmail.com>
	<CAA4eK1JwVewYZc7eyF9x2-G+Y1ikgU5+a5gmQR+ssft++V51ZA@mail.gmail.com>
	<CAHGQGwHo8f+d3wF-beh6fQnftAkJUyd4mLm2Kg_m41Dg+6dCQQ@mail.gmail.com>
	<CAA4eK1Kb_-zVDcoTP34FZjYcgXAHkUu-vmmGYtH5Tg0o+jW_mQ@mail.gmail.com>
	<CAHGQGwGprr+1ycMFpkni4fOM=CGt7iO1yGnJROHqU59sewV0-Q@mail.gmail.com>
	<CAHGQGwH_AAbtsiYDJt65N7_4PJ0CgOJmBEaCq68e5_tcuG_vXw@mail.gmail.com>

On Wed, Apr 8, 2026 at 12:36 PM Fujii Masao <[email protected]> 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


Attachments:

  [application/octet-stream] v1-0001-pg17-Fix-ABI-break-by-moving-PROCSIG_SLOTSYNC_MESSAGE-.patch (1.6K, 2-v1-0001-pg17-Fix-ABI-break-by-moving-PROCSIG_SLOTSYNC_MESSAGE-.patch)
  download | inline diff:
From d6ad4847ddbedeafad682653d30eaaf0ad8dedb7 Mon Sep 17 00:00:00 2001
From: Fujii Masao <[email protected]>
Date: Wed, 8 Apr 2026 12:53:23 +0900
Subject: [PATCH v1] Fix ABI break by moving PROCSIG_SLOTSYNC_MESSAGE in
 ProcSignalReason

Commit 58c1188a3ea added PROCSIG_SLOTSYNC_MESSAGE in the middle of
enum ProcSignalReason, breaking the ABI.

Fix this by moving PROCSIG_SLOTSYNC_MESSAGE to the end of the enum.

Per buildfarm member crake.

Discussion: https://postgr.es/m/CAHGQGwH_AAbtsiYDJt65N7_4PJ0CgOJmBEaCq68e5_tcuG_vXw@mail.gmail.com
---
 src/include/storage/procsignal.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/include/storage/procsignal.h b/src/include/storage/procsignal.h
index 126c44bcf1d..db59d266a2c 100644
--- a/src/include/storage/procsignal.h
+++ b/src/include/storage/procsignal.h
@@ -36,7 +36,6 @@ typedef enum
 	PROCSIG_BARRIER,			/* global barrier interrupt  */
 	PROCSIG_LOG_MEMORY_CONTEXT, /* ask backend to log the memory contexts */
 	PROCSIG_PARALLEL_APPLY_MESSAGE, /* Message from parallel apply workers */
-	PROCSIG_SLOTSYNC_MESSAGE,	/* ask slot synchronization to stop */
 
 	/* Recovery conflict reasons */
 	PROCSIG_RECOVERY_CONFLICT_FIRST,
@@ -49,9 +48,11 @@ typedef enum
 	PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK,
 	PROCSIG_RECOVERY_CONFLICT_LAST = PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK,
 
-	NUM_PROCSIGNALS				/* Must be last! */
+	PROCSIG_SLOTSYNC_MESSAGE	/* ask slot synchronization to stop */
 } ProcSignalReason;
 
+#define NUM_PROCSIGNALS (PROCSIG_SLOTSYNC_MESSAGE + 1)
+
 typedef enum
 {
 	PROCSIGNAL_BARRIER_SMGRRELEASE, /* ask smgr to close files */
-- 
2.51.2



  [application/octet-stream] v1-0001-pg18-Fix-ABI-break-by-moving-PROCSIG_SLOTSYNC_MESSAGE-.patch (1.6K, 3-v1-0001-pg18-Fix-ABI-break-by-moving-PROCSIG_SLOTSYNC_MESSAGE-.patch)
  download | inline diff:
From 8c7f964d5c56fa40b83fdda21e610594fd634897 Mon Sep 17 00:00:00 2001
From: Fujii Masao <[email protected]>
Date: Wed, 8 Apr 2026 11:58:43 +0900
Subject: [PATCH v1] Fix ABI break by moving PROCSIG_SLOTSYNC_MESSAGE in
 ProcSignalReason

Commit 58c1188a3ea added PROCSIG_SLOTSYNC_MESSAGE in the middle of
enum ProcSignalReason, breaking the ABI.

Fix this by moving PROCSIG_SLOTSYNC_MESSAGE to the end of the enum.

Per buildfarm member crake.

Discussion: https://postgr.es/m/CAHGQGwH_AAbtsiYDJt65N7_4PJ0CgOJmBEaCq68e5_tcuG_vXw@mail.gmail.com
---
 src/include/storage/procsignal.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/include/storage/procsignal.h b/src/include/storage/procsignal.h
index c4a59325604..234cfcb364a 100644
--- a/src/include/storage/procsignal.h
+++ b/src/include/storage/procsignal.h
@@ -36,7 +36,6 @@ typedef enum
 	PROCSIG_BARRIER,			/* global barrier interrupt  */
 	PROCSIG_LOG_MEMORY_CONTEXT, /* ask backend to log the memory contexts */
 	PROCSIG_PARALLEL_APPLY_MESSAGE, /* Message from parallel apply workers */
-	PROCSIG_SLOTSYNC_MESSAGE,	/* ask slot synchronization to stop */
 
 	/* Recovery conflict reasons */
 	PROCSIG_RECOVERY_CONFLICT_FIRST,
@@ -48,9 +47,11 @@ typedef enum
 	PROCSIG_RECOVERY_CONFLICT_BUFFERPIN,
 	PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK,
 	PROCSIG_RECOVERY_CONFLICT_LAST = PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK,
+
+	PROCSIG_SLOTSYNC_MESSAGE,	/* ask slot synchronization to stop */
 } ProcSignalReason;
 
-#define NUM_PROCSIGNALS (PROCSIG_RECOVERY_CONFLICT_LAST + 1)
+#define NUM_PROCSIGNALS (PROCSIG_SLOTSYNC_MESSAGE + 1)
 
 typedef enum
 {
-- 
2.51.2



view thread (42+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion?
  In-Reply-To: <CAHGQGwF7QvpRZL6sT3m5EeuacL4SePqmMu1+zJiJc3V2u-tBOA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox