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 1oxL48-0002YH-HV for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Nov 2022 04:39:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oxL47-0003be-Cr for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Nov 2022 04:39:23 +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 1oxL46-0003aF-TC for pgsql-hackers@lists.postgresql.org; Tue, 22 Nov 2022 04:39:23 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oxL43-0004SP-VB for pgsql-hackers@postgresql.org; Tue, 22 Nov 2022 04:39:21 +0000 Received: by mail-pl1-x62e.google.com with SMTP id w23so12481583ply.12 for ; Mon, 21 Nov 2022 20:39:19 -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=yjClxU2h51E8fA2VD1K7xDTVWvoKHqjJnccxf2hPkE8=; b=Z9L6jkF+XIdtECXjXaKuHTHyzf6UKwJTAZZ4zpKydGmPa9AcJAgAu7LiGo7wErmQ0S bpFFAT0GfP5pgxlJLMqbKKooCisA9DUT63/ECDo3QKT9UEaCY8AgcEbKVRLJ/II1WLaJ KF0cVREeee2LcafN1VEPU0sVFoA7mao3JPD+3iC30pX66Yg1CAfYkYjyzY9/gvQc4RAd aZyJx/gVqRbAzGHslxXc0ljtIwG6kGMqXnLgfOdIWWPPs861cuouf0m28viX4bSqSqWd UI9KxriM2y10s93R5kDqqaAvNGnYJQT0pwuP2xr/4u5JGPdHF/l9Sk0QUl0lMZhwOO7l m35g== 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=yjClxU2h51E8fA2VD1K7xDTVWvoKHqjJnccxf2hPkE8=; b=jPv7YJil78FCWqt6bEVhpTV3UnPxNaHNHtNbdpCL56h/pS5zX9qPLuf3aB97Q1WzSI qb5Xrk2kpFhfaV5YlHofRz5h5ZGWYL80cV/3KQ/Gc9DmN7WVm26S2M/AXcKX6EhX0Rz9 iKsJuIGXLSNTaHZRxgja+suJ/XcHhsoU55RiyxaADnxiL0Z7XrelrgZ/Y6oEoHYdZdVL Sf2y7Y0bVnZ0E20YeJuzcphu707sKRE6BqM/GIMUuH7pp6yYeFuMs6Vw9ku4VmWJtwAK owEtemY7CLBSTkC8fcEZt5/rAg2sZ4YRfRiQJ9wE7g89FOfMATqKkNvZHfjqADi/cBLn OSHw== X-Gm-Message-State: ANoB5pkCmyasC1mg8CDMgI0Y20xcXh4NQf8slQsVjL+3hQ3QcnhR+/wv hLKOU7E+7rHh5qlF0pPpRW4= X-Google-Smtp-Source: AA0mqf74Iu4/knXEFxjgZWz/ZqN4CZUTqPAMxJIdIc/ITw8HTvm3Y+fl+ILJNTsyoxOHtT99OXraCg== X-Received: by 2002:a17:902:6a86:b0:187:722:f4db with SMTP id n6-20020a1709026a8600b001870722f4dbmr2825520plk.87.1669091958965; Mon, 21 Nov 2022 20:39:18 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id j5-20020a170902c3c500b0018853416bbcsm10677261plj.7.2022.11.21.20.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 20:39:18 -0800 (PST) Date: Mon, 21 Nov 2022 20:39:16 -0800 From: Nathan Bossart To: "Hayato Kuroda (Fujitsu)" Cc: "pgsql-hackers@postgresql.org" Subject: Re: wake up logical workers after ALTER SUBSCRIPTION Message-ID: <20221122043916.GA230228@nathanxps13> References: <20221122004119.GA132961@nathanxps13> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ibTvN161/egqYuK8" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ibTvN161/egqYuK8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Nov 22, 2022 at 03:03:52AM +0000, Hayato Kuroda (Fujitsu) wrote: > Just One comment: IIUC the statement "ALTER SUBSCRIPTION" can be executed > inside the transaction. So if two subscriptions are altered in the same > transaction, only one of them will awake. Is it expected behavior? > > I think we can hold a suboid list and record oids when the subscription are > altered, and then the backend process can consume all of list cells at the end of > the transaction. I think you are correct. I did it this way in v2. I've also moved the bulk of the logic to logical/worker.c. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com --ibTvN161/egqYuK8 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-wake-up-logical-workers-after-ALTER-SUBSCRIPTION.patch"