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 1p2ytl-0007fK-W4 for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Dec 2022 18:12:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2ytj-00048B-Sh for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Dec 2022 18:11:59 +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 1p2ytj-000476-FO for pgsql-hackers@lists.postgresql.org; Wed, 07 Dec 2022 18:11:59 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p2yta-00088c-Lp for pgsql-hackers@postgresql.org; Wed, 07 Dec 2022 18:11:57 +0000 Received: by mail-pj1-x1029.google.com with SMTP id hd14-20020a17090b458e00b0021909875bccso4017874pjb.1 for ; Wed, 07 Dec 2022 10:11:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=JCQ7h8NNbtUFknb1bD/+MPrY3Stdwm1DAhmFAO0I12E=; b=UfwQxxZVPB82+NDs4cEIJsIg9QrRDN0m7CXKhdEMg7m4IurQ358EeUuaRPwEzIATPC K0M4hWYOjj1lSw63fjXwfj77KqUO8gyG1o3n48L1A8DEb8rJGAkVvj8m0S9aMn5c2xIC hpHAnr3I3efufiA6NgsPHKo00vaTvL1sYzguV8zYbGPRXpZZMYyZSYm/AZxUXVn8xWVv jxsc+0SR4IX0sP3AlculjZw85LrbZKXH4STNz89im9x2JgzJgn4rxG2WLKmjEzMu/Sk5 KneIugQMGBVIa2Om11OK1hsaOXW31WNYaFv37hLYCnw8fn7wc076P/4M4r5jE7yvyhTk 1/VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding: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=JCQ7h8NNbtUFknb1bD/+MPrY3Stdwm1DAhmFAO0I12E=; b=Q7OZUwitWBY5AWGjP0m4MRH3cf3hgBVxoc0TvY+wa71Z5Uxowgbzr0utXHZqAdVBln lckMT+ZPQ8IwONWz7LeA2MPsSyjEkbiNQv3KPXiiaIjoKTLpBLNk7yV8xaFWrvB7vCTx PIpiSva7sKhTAXfX9L7PURrq4L4ceLh73YGmOYKN2k6k1OqAXZmatqNz5Ck470kFOM3j ZLASNPzFgidan19/fJtu362OnDb50fVhhqyZic7v/ku6jZcCxbsd5sgcgPCUI6Fs8qGD uEFvwGYP9Ai1FUDbj4Rd1MB5lOHnc7stJNwb/LbkbUlmc59qLmE1ZDfbwFvb71RW1ZuN JFXQ== X-Gm-Message-State: ANoB5pmmNNmx6bIqqJd8/1wk7+qCXJte3k2QRS3WRXuZ3Xa5LIwSdJhG Xlpdx+W8cV9aW7ZAtJkKSFs= X-Google-Smtp-Source: AA0mqf7UjY+R1gNgbfdoi56Q1NHglt5AFqZO3bJbecBT3hKJnEauz/OEtM0rgylo1cGWgkux6gQkAA== X-Received: by 2002:a17:903:2055:b0:189:d3d9:930b with SMTP id q21-20020a170903205500b00189d3d9930bmr16129365pla.85.1670436708178; Wed, 07 Dec 2022 10:11:48 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id iw10-20020a170903044a00b001871461688esm11515597plb.175.2022.12.07.10.11.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 10:11:47 -0800 (PST) Date: Wed, 7 Dec 2022 10:11:45 -0800 From: Nathan Bossart To: Melih Mutlu Cc: Thomas Munro , "Hayato Kuroda (Fujitsu)" , "pgsql-hackers@postgresql.org" Subject: Re: wake up logical workers after ALTER SUBSCRIPTION Message-ID: <20221207181145.GA3698731@nathanxps13> References: <20221130041028.GA1604177@nathanxps13> <20221130050441.GA1677223@nathanxps13> <20221202002130.GA2124877@nathanxps13> <20221202192101.GB2277157@nathanxps13> <20221206192551.GA3078082@nathanxps13> <20221206212954.GA3403597@nathanxps13> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Wed, Dec 07, 2022 at 02:07:11PM +0300, Melih Mutlu wrote: > 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. After sleeping on this, I think we can do better. IIUC we can simply check for AllTablesyncsReady() at the end of process_syncing_tables_for_apply() and wake up the logical replication workers (which should just consiѕt of setting the current process's latch) if we are ready for two_phase mode. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com --45Z9DzgjV8m4Oswq Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v8-0001-wake-up-logical-workers-as-needed-instead-of-rely.patch"