Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAPTY-002MEc-1L for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 09:45:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAPTW-006PEz-2w for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 09:45:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAPTW-006PEr-1o for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 09:45:31 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wAPTV-00000001H6L-05KQ for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 09:45:30 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5a10d130b37so633360e87.0 for ; Wed, 08 Apr 2026 02:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775641523; cv=none; d=google.com; s=arc-20240605; b=Ee1qqzakXRyK2K60ckZK3pi55xa8q0sOPSj4LDo1QaaTBhvr6+2XnvgMQUJ9Ggasj/ aslKMsuSGwnanKGRPoc7ehel9rkN3JyVdJzDGFbNuyYNyjOUzxNGSsQVm0VTmorSyTH/ YxLk7PiFwDmvmNdcN9xzdkqn2XSiSvNW2ymH2V7PAs+E610WMdKRdhILmEY/8h7l9xHe moMqrAWQuBb7v3i5LY1GIBOlWd+J+nNQoUXIK4uS658v1e+2GV+y8TTPktVe6ZwBOcji tRfPiCRZF0XXYuogmQwNt1IAdE/8TRNOUe4/Np/yXS95Rbvw1SUBl1DlNPWK7ThQAB61 FNMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AykK5eW4OSckNK0IGFIp6A4YwePWgiKPW5YkdnSD+2c=; fh=mEIYcH1i7embO4LFOLbUvBsES61eRpeQ6MWyl5u8HaQ=; b=jhCJ9xIU7GCx2ofiluEPbYfx7WcgjXxkETcpEzogt1Lkp6KDoaVlG1kyrk8DTWGLVK 1EAu2Z/tJWqhj9iC+griVI1dCdB77IohLbGMTHGmU4q0knhfMS/mqfqPoOgsoGSBsym+ uj4jXw4n09n7Wrv4pEJvFt5GMz9lnCp2Vx1ccQez10bQdZ0nrkhM1MkflRTucDjBJgYk hD5tBer5H94VmX1K0li9/oRUeocFgDjnd+ewJa4d6G8sw/TrgK1f7dX1fM2cF+OLURxk IKB0DTZtAdytaFEAw1mAfSZfOCltZUvXwO/pZvWy75udsFL/N2MEthuB9v8eH00u2Ykf Ua/w==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775641523; x=1776246323; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=AykK5eW4OSckNK0IGFIp6A4YwePWgiKPW5YkdnSD+2c=; b=EKNdzxih7DtITEyRf/aqxSgSjGXZpKiIqVdrWOMBKdfyHlRqTy9pqYSPIC8AIIrQSU 5m05BHwU90FAoMbExW6m1/lyWL240qARLMT8A6+uegvc3bEeJkwOLD0k0mARP8HdPcVy tVUdS3O85mxUtEBB20tmrXveNigWcYVWxux88A9IbYPiItRhM8e7eEwuaaZYlOPEo30+ t+KPq2oHDwM6jtS5z12XFxU/POjcJEQhCGrhx3cUuzkM5aIrMktOArK+/qpweNkPmGvw Q71xZZol77Sby3XsruUQv7ZxcVNceN/rMfozAxg81xfSiIUhkjDv/n50uiHEwSeu5+1R euTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775641523; x=1776246323; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AykK5eW4OSckNK0IGFIp6A4YwePWgiKPW5YkdnSD+2c=; b=JxHezvoCoT5SNqd7yp3R+oBl31yQBoXNZgiB1OKi5CgGSQe7E+LXjPj6nqaigXgpTk jBOmnwU6Jkmw58bVISUapklglEN9ZEMJL98Tb45QrqQK1OKhiJ1VF0gjZFBYE5H1khV9 OEendN6IBC4L3yhvoEnywvt63yb7vcXoWeAp0PwIecnppKHKRjIU/NJNqPqGUxSoswJD DwcZfOR7jaYsxCpnD0dPxC1Zblo1gkGVF74Lkx1RD+Jl8kHlgXGqeiIpY2G3Rlu1yIZ/ Q+rIkck4AvnO7ubjIwJflT582MlT2KKudpeIvFnOfY8ucTOYyTlhANs1I+klW07mxQWF 0lSA== X-Forwarded-Encrypted: i=1; AJvYcCVbJhtcbyc6Upfe2hRoXxqXR3rW0hZ7etMMgCy03iFWnEweoak8vbhA7T6+4eCG+n/S8CEQG79YVhVQ5758@lists.postgresql.org X-Gm-Message-State: AOJu0YxSdw9wInDqJyidS3ygglVknLu58Yc6gfF7UTPcaQHKQ+wPCg5Y obAdUgiXgux4RVf2o67WdEOEIJaDrPT2H5YSHaWG0s+o/Y8/5iu2GAmWrGBrFCYIiA8taDKO/5d JYcwDEZ0axRCGCG6diCCsqhn2Ot6zOg== X-Gm-Gg: AeBDiesSbvjZ4eqilbXY8EkzZfm2TI+gEOJGjGrbVTm9a5ffAkS3XrgIxy3YSmDY4+B rL3hLHIgPTyst/4XEhv+Lqtl3lA5fXbNNFqQcOHWZuzKmmBiI3ceUIJc46Usq8O2XK9MKNwbri+ IGy7+jYlfbkKuTgzwHWGg/3r88nYgcVOPkbXXKTyF8TsKvhvtqSHJWymtNB8yQjA6+KlIJw7Mz9 j7sfBDzm2a1J77HY2DumUS8n4ly/YdumB1UYOb80qm0t4tvyxasKAGnh7Xn3adw6WIIckJbDONJ wqebAIDwywlJnQeTwhE64H4vaHimfL55msKt3p4= X-Received: by 2002:a05:6512:3ca2:b0:5a2:c66a:d6d1 with SMTP id 2adb3069b0e04-5a32f6c6089mr5914940e87.6.1775641522964; Wed, 08 Apr 2026 02:45:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nisha Moond Date: Wed, 8 Apr 2026 15:15:10 +0530 X-Gm-Features: AQROBzDCrgeGCHIEJJKnnyViWwRa_pvLUdMz3TCuK455N78sQ1KJp2vFPKVdRaI Message-ID: Subject: Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion? To: Fujii Masao Cc: Amit Kapila , "Zhijie Hou (Fujitsu)" , shveta malik , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Apr 8, 2026 at 12:24=E2=80=AFPM Fujii Masao = wrote: > > On Wed, Apr 8, 2026 at 12:36=E2=80=AFPM Fujii Masao wrote: > > The backpatch added PROCSIG_SLOTSYNC_MESSAGE in the middle of enum > > ProcSignalReason, which could break the ABI. I=E2=80=99m planning to mo= ve 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 m= eaning > > 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. > Regarding the pg17 change, NUM_PROCSIGNALS is not a process signal reason but simply represents the array size, and its value will also increase in pg18 (+1) after this backpatch. AFAIU, the concern is that extensions might rely on the old compiled values of PROCSIG_*, so we should avoid changing their order. However, extensions should also not depend on NUM_PROCSIGNALS directly, otherwise the pg18 backpatch would pose the same ABI concern. So, it seems safe for pg17 as well. I also checked core extensions and did not find NUM_PROCSIGNALS being used. That said, I think both approaches - adding the new entry at the end and defining NUM_PROCSIGNALS outside as done in the patch or adding it just before NUM_PROCSIGNALS (like below) are semantically the same. =E2=80=A6. PROCSIG_RECOVERY_CONFLICT_LAST =3D PROCSIG_RECOVERY_CONFLICT_STARTUP_DEAD= LOCK, + PROCSIG_SLOTSYNC_MESSAGE /* ask slot synchronization to stop */ + NUM_PROCSIGNALS /* Must be last! */ } ProcSignalReason; As NUM_PROCSIGNALS increments in both cases, I don=E2=80=99t see any additional benefit in defining it outside. Thoughts? Happy to be corrected if I=E2=80=99m missing something. -- Thanks, Nisha