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 1p5b0L-0002Mo-Gm for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Dec 2022 23:17:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5b0K-0002JU-0a for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Dec 2022 23:17:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5b0J-0002JL-MY for pgsql-hackers@lists.postgresql.org; Wed, 14 Dec 2022 23:17:35 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p5b0H-0006Yx-9B for pgsql-hackers@postgresql.org; Wed, 14 Dec 2022 23:17:35 +0000 Received: by mail-pf1-x434.google.com with SMTP id t18so5522552pfq.13 for ; Wed, 14 Dec 2022 15:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZJF6IC2TPhWRilwC29yvSUV909Cjz7tWzq4p+yfX7Bg=; b=XnG7nCg6R1ig8CYuez+9jkrTEkU1xeFPY4k2TQ2Z2qcCRLqlENiBcVszAY9ENK2dkM rI6Xgcsy5z5PLnrd+Vwl3zfDvmgkpvXUtPOV5QXsCbMAUQCWyUWikinMhUUEOUguwndj Wfr2gJrkJ5/+n91bQbWMqCBSuBv8FJB9QQdvIHbI+pBkkr8pNuetHKuCK0QAu3He0sXS a6j3ZB/e2QtZdVSdX3Pkpno5novx9txgkTpX17u+HJUogzrtozG8F4JYTPlxVj27N2Zb 8Qk9QQnHTnuomWzIBSb9jum6Z3HFpn3as0vdciMHQcA3MDavNO6SR1X9y+cB+NvltNtc eU2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZJF6IC2TPhWRilwC29yvSUV909Cjz7tWzq4p+yfX7Bg=; b=aHZdBFStHwaQgkGNkgediOvbyoNLELQkAcRIE5PEmKgK7A21Y2McKsVPCshTELsKmH 6h+crF6WSHTtJj7qfrQYd/B7Xx2yCHYVrqyB71RThI3GOVFAMo/QCSWmp/qxj0gW+/+j 8n0/ns77b9HMsU2/sumZEQ5MiLGk6WZk7B3WD66uamRiAn5uo8t+jxKMDIj6snTPeow0 yjOs39eP/wPhfiPfRrMuL5DYpIsq628R5XejthtM31ESeK4AyCryfIWeK//f7LijR2Kf OnQV+TxW2VeG+JrReAjwv59PWraKbW5nWuJ4Bi/IobgxRV24qqzB7heU46F04NWB/12z 1Bbg== X-Gm-Message-State: ANoB5pltbEkIvJAnwKKHdspDgY1sW4YyAxM6DhIGlErrz1TqRsyioSdq 6rb9IzIBX4IJiKDkFiGguiY= X-Google-Smtp-Source: AA0mqf4p5A5RtYiKcyvGR+SKIWaBOfb8F5bNYGgLLpy3seabsSDdokDZvNYNHdnf+woOMXE5pl+geg== X-Received: by 2002:aa7:8252:0:b0:574:c62c:2f55 with SMTP id e18-20020aa78252000000b00574c62c2f55mr24713828pfn.3.1671059850957; Wed, 14 Dec 2022 15:17:30 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id 125-20020a620483000000b00576670cc16dsm336563pfe.197.2022.12.14.15.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 15:17:30 -0800 (PST) Date: Wed, 14 Dec 2022 15:17:27 -0800 From: Nathan Bossart To: Tom Lane Cc: Melih Mutlu , Thomas Munro , "Hayato Kuroda (Fujitsu)" , "pgsql-hackers@postgresql.org" Subject: Re: wake up logical workers after ALTER SUBSCRIPTION Message-ID: <20221214231727.GA828014@nathanxps13> References: <2550453.1670974328@sss.pgh.pa.us> <20221214000145.GA638663@nathanxps13> <2561155.1670977214@sss.pgh.pa.us> <20221214004105.GA669835@nathanxps13> <20221214171023.GA689106@nathanxps13> <2707695.1671039752@sss.pgh.pa.us> <20221214174535.GA773264@nathanxps13> <2783450.1671042198@sss.pgh.pa.us> <20221214183759.GC773264@nathanxps13> <2787771.1671044578@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2787771.1671044578@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Dec 14, 2022 at 02:02:58PM -0500, Tom Lane wrote: > Maybe we could have workers that are exiting for that reason set a > flag saying "please restart me without delay"? That helps a bit, but there are still delays when starting workers for new subscriptions. I think we'd need to create a new array in shared memory for subscription OIDs that need their workers started immediately. I'm not totally sure this is worth the effort. These delays surface in the tests because the workers are started so frequently. In normal operation, this is probably unusual, so the launcher would typically start new workers immediately. But if you and/or others feel this is worthwhile, I don't mind working on the patch. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com