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 1p2sGu-0004Ap-Qc for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Dec 2022 11:07:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2sGt-0007GB-MU for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Dec 2022 11:07:27 +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 1p2sGt-0007G2-CC for pgsql-hackers@lists.postgresql.org; Wed, 07 Dec 2022 11:07:27 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p2sGq-0003fw-Tn for pgsql-hackers@postgresql.org; Wed, 07 Dec 2022 11:07:26 +0000 Received: by mail-pj1-x1032.google.com with SMTP id t11-20020a17090a024b00b0021932afece4so1106957pje.5 for ; Wed, 07 Dec 2022 03:07:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HTFISIffMgV1V6DF7DcO1DGpqEFY1gkuAbBOjE+LKXs=; b=R6Cd8v90PncerxqGcu7XnSOj5dPr3KNtDKvpLGTdy/TPnGC7KbUWVf+qFHW2GS/vPR SUOs6iD0DQGx54c3nkyjLhGu4yC/osRvY0A31vnpJR9jX3xL/Q25jRQieU0aoaxVzbqj vTREAPbrz6elLuNIVSHp/+tLUMVtuFUF1Baa6IPGyv3OP3M8Ks8R0iWrKdnNSzF7XcO0 3MNatwgKd+Uxj9UN2MVxP/iM/LFVSR0mkdWa/ve+t0fpzu9z1hrrcDlYsBhBw7U6wesD k3zuAKy7VgzOvNta/bJMP4VUSTi0s5l13R5n8aHTEaZTvdlZCfHPJ1VNNN5fxmydLh6u mPIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HTFISIffMgV1V6DF7DcO1DGpqEFY1gkuAbBOjE+LKXs=; b=TGPhIF0m6E8sdz/Bqu2KkFohSvPmXhe3tqETIcHSdvLi2uIV39jd3nTVmnSpYzN23/ UVrU2ctVRn72hBvxsRb7ZRymLhsIgqx4J8ZEuj10lkbP6NtribGtIK5XMnwqdNCbsYWt zZLWBJLJFxF10bKej5rPPQWWCWF/3bF/8eYHE5MbBjLV369tLhWz4eLKRTAcsr6x04Dx tQj9tFeB4lqs3/raXq1JhnnGv2eKbWhzo/tUXtSmWxrHC15vBghqhApormSD4YddWAp5 2cjx2AGfqQx5xfC+z7xDFCBB9A18I3GKSxi5HGCXs2D+y0UQdAmwSDNKoj9QXD12wzjo 9DqQ== X-Gm-Message-State: ANoB5plwVSGfuofcCju7XgW6Xk0UdZEGbiIPJBO2GajpxQDr8S70UWxl HR90xd0wMpLsIN+ALoFg7eFYbFVuhIZinIsvGNA= X-Google-Smtp-Source: AA0mqf5u844GMtoLhTdhU7fzzgemr/SJTAPgmhYItA67U66dsS8MGxsRFOvNGdhgrK+k6rjui+y5sVZExJkASrNzoLc= X-Received: by 2002:a17:90b:35cb:b0:213:22d:b2e2 with SMTP id nb11-20020a17090b35cb00b00213022db2e2mr43232084pjb.148.1670411242893; Wed, 07 Dec 2022 03:07:22 -0800 (PST) MIME-Version: 1.0 References: <20221127234528.GB878043@nathanxps13> <20221130041028.GA1604177@nathanxps13> <20221130050441.GA1677223@nathanxps13> <20221202002130.GA2124877@nathanxps13> <20221202192101.GB2277157@nathanxps13> <20221206192551.GA3078082@nathanxps13> <20221206212954.GA3403597@nathanxps13> In-Reply-To: <20221206212954.GA3403597@nathanxps13> From: Melih Mutlu Date: Wed, 7 Dec 2022 14:07:11 +0300 Message-ID: Subject: Re: wake up logical workers after ALTER SUBSCRIPTION To: Nathan Bossart Cc: Thomas Munro , "Hayato Kuroda (Fujitsu)" , "pgsql-hackers@postgresql.org" Content-Type: multipart/alternative; boundary="000000000000c2f52905ef3aec7d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c2f52905ef3aec7d Content-Type: text/plain; charset="UTF-8" Hi, > Actually, that's not quite right. The sync worker will wake up the apply > worker to change the state from SYNCDONE to READY. AllTablesyncsReady() > checks that all tables are READY, so we need to wake up all the workers > when an apply worker changes the state to READY. Each worker will then > evaluate whether to restart for two_phase mode. > Right. I didn't think about the two phase case thoroughly. Waking up all apply workers can help. Do we also need to wake up all sync workers too? Even if not, I'm not actually sure whether doing that would harm anything though. Just asking since currently the patch wakes up all workers including sync workers if any still exists. Best, -- Melih Mutlu Microsoft --000000000000c2f52905ef3aec7d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
=C2=A0
=
Actually, that's not = quite right.=C2=A0 The sync worker will wake up the apply
worker to change the state from SYNCDONE to READY.=C2=A0 AllTablesyncsReady= ()
checks that all tables are READY, so we need to wake up all the workers
when an apply worker changes the state to READY.=C2=A0 Each worker will the= n
evaluate whether to restart for two_phase mode.

Right. I didn't think about the two phase case=C2=A0thoroughly= . Waking up all apply workers can help.

Do we = also need to wake up all sync workers too? Even if not, I'm not actuall= y sure whether doing that would harm anything though.
Just asking= since currently the patch wakes up all workers including sync workers if a= ny still exists.

Best,
--
Meli= h Mutlu
Microsoft
--000000000000c2f52905ef3aec7d--