Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pJfm5-0003CQ-4n for pgsql-hackers@arkaria.postgresql.org; Sun, 22 Jan 2023 19:13:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pJfm3-0000W6-Ra for pgsql-hackers@arkaria.postgresql.org; Sun, 22 Jan 2023 19:13:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pJfm3-0000Vw-IL for pgsql-hackers@lists.postgresql.org; Sun, 22 Jan 2023 19:13:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pJflx-000187-9E for pgsql-hackers@postgresql.org; Sun, 22 Jan 2023 19:13:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 30MJCsVG1353773; Sun, 22 Jan 2023 14:12:54 -0500 From: Tom Lane To: Nathan Bossart cc: Amit Kapila , Melih Mutlu , Thomas Munro , "Hayato Kuroda (Fujitsu)" , "pgsql-hackers@postgresql.org" Subject: Re: wake up logical workers after ALTER SUBSCRIPTION In-reply-to: <20230110174345.GA1292607@nathanxps13> References: <20230105041237.GA189619@nathanxps13> <20230105044622.GA256534@nathanxps13> <20230105171933.GB299579@nathanxps13> <20230106054017.GA786807@nathanxps13> <3355444.1673044286@sss.pgh.pa.us> <20230107004525.GB789289@nathanxps13> <20230110174345.GA1292607@nathanxps13> Comments: In-reply-to Nathan Bossart message dated "Tue, 10 Jan 2023 09:43:45 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1353771.1674414774.1@sss.pgh.pa.us> Date: Sun, 22 Jan 2023 14:12:54 -0500 Message-ID: <1353772.1674414774@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > On Tue, Jan 10, 2023 at 10:59:14AM +0530, Amit Kapila wrote: >> I haven't looked in detail but isn't it better to explain somewhere in >> the comments that it achieves to rate limit the restart of workers in >> case of error and allows them to restart immediately in case of >> subscription parameter change? > I expanded one of the existing comments to make this clear. I pushed v17 with some mostly-cosmetic changes, including more comments. > Of course, if the launcher restarts, then the notify_pid will no longer be > accurate. However, I see that workers also register a before_shmem_exit > callback that will send SIGUSR1 to the launcher_pid currently stored in > shared memory. (I wonder if there is a memory ordering bug here.) I think it's all close enough in reality. There are other issues in this code, and I'm about to start a new thread about one I identified while testing this patch, but I think we're in good shape on this particular point. I've marked the CF entry as committed. regards, tom lane