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 1p5FDi-00085J-QV for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Dec 2022 00:01:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5FDh-0006wi-7z for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Dec 2022 00:01:57 +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 1p5FDg-0006wY-Su for pgsql-hackers@lists.postgresql.org; Wed, 14 Dec 2022 00:01:56 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p5FDa-0001Td-5F for pgsql-hackers@postgresql.org; Wed, 14 Dec 2022 00:01:56 +0000 Received: by mail-pj1-x102a.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so5354948pjj.2 for ; Tue, 13 Dec 2022 16:01:49 -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=yN6LI/Td2PeQBKxcTwHz67F6m+mv0AWMTIhSh6ObSW4=; b=keZpjgHT+otM6wu9c0aL1nYD+D3Qf1YcDGdiYpYT/ju1B5QlPFz7qMQafxf2XTHizh 651PqZPqxTx4zX4O5Tsmm/UplyAliJkaN8ywizvd3sOglBmKP7dkAMdIews0ZorjsFxi lPAVhx/KJcQkRTpwe94J2afbrLp+DloG+IfHkeaBk2/GnoY0J+88Y9bQExfkLgG3Rvlu vggADzDnSZRnY16H3pvw2z9d/zwElSaYvHdhSNKAXMSb7MBNU2uFIm+iREfWavNMHwjx +/X+/U+Mri+Mu2moRF4EoRS5pmd7lD+iyCUFDeYpUZli1/s1Q1e4K56UkgLAAyfMGUZX Wggw== 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=yN6LI/Td2PeQBKxcTwHz67F6m+mv0AWMTIhSh6ObSW4=; b=s2ZT3puOdlWWWR0OdT8Cb9dZYc2yqHmDgOZadnAbztRkSy3E61ShhlM41EPtTD07ko b7usxpDTkm0RALLmdTrAZCO1rsXXj68fWPAg2YQ4jN690YRzNDla7XACEcJPH1ao/LCc tDVZtKJwxa+5/E7qXEcDT1F+iQdWJakhXcSf6PEF6xtqqLoAOdeupdAS7wzwxbKVy7vS hzn81dDFi36HXqKnlM8EJJ5rFkhwGkvbyY0ENwiMR6nMRADxDQ6GrlPRW9rgNX6fo8V+ HVa+8LsSqQd+hMm/nMYmsiyDBYq5VV59QmwEcuX/cZf79Wubx2n+Mw/TpaN9hvmTNHBb Efvg== X-Gm-Message-State: ANoB5pnqk+8fUIj8MjITt25E1Gz19YDHrDhi7D4PqgVliqFJnlHLJUDr moV3Pb44V1q4G4P7Q3htUg2ITHqXmRw= X-Google-Smtp-Source: AA0mqf7M5IXm3GJ4XbgcBdMHbqyNuwHcDkDOWOKKtOD+Wad580Q2K+GOQqongJpAQlTlJ2ZMUELgmQ== X-Received: by 2002:a05:6a20:8f04:b0:a4:aa40:2260 with SMTP id b4-20020a056a208f0400b000a4aa402260mr41661238pzk.60.1670976107834; Tue, 13 Dec 2022 16:01:47 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id f5-20020aa79685000000b0057726bd7335sm8181502pfk.121.2022.12.13.16.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Dec 2022 16:01:47 -0800 (PST) Date: Tue, 13 Dec 2022 16:01:45 -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: <20221214000145.GA638663@nathanxps13> References: <20221130050441.GA1677223@nathanxps13> <20221202002130.GA2124877@nathanxps13> <20221202192101.GB2277157@nathanxps13> <20221206192551.GA3078082@nathanxps13> <20221206212954.GA3403597@nathanxps13> <20221207181145.GA3698731@nathanxps13> <2550453.1670974328@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2550453.1670974328@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Dec 13, 2022 at 06:32:08PM -0500, Tom Lane wrote: > Before, there was up to 1 second (with multiple "SELECT count(1) = 0" > probes from the test script) between the ALTER SUBSCRIPTION command > and the "apply worker will restart" log entry. That wait is pretty > well zapped, but instead now we're waiting hundreds of ms for the > "apply worker has started" message. > > I've not chased it further than that, but I venture that the apply > launcher also needs a kick in the pants, and/or there needs to be > an interlock to ensure that it doesn't wake until after the old > apply worker quits. This is probably because the tests set wal_retrieve_retry_interval to 500ms. Lowering that to 1ms in Cluster.pm seems to wipe out this particular wait, and the total src/test/subscription test time drops from 119 seconds to 95 seconds on my machine. This probably lowers the amount of test coverage we get on the wal_retrieve_retry_interval code paths, but if that's a concern, perhaps we should write a test specifically for wal_retrieve_retry_interval. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com