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 1otOMW-0003gP-Uc for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Nov 2022 07:22:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1otOMU-0006n0-2w for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Nov 2022 07:22:02 +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 1otOMT-0006mr-O1 for pgsql-hackers@lists.postgresql.org; Fri, 11 Nov 2022 07:22:01 +0000 Received: from mail-yb1-xb32.google.com ([2607:f8b0:4864:20::b32]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1otOMR-0002am-0d for pgsql-hackers@lists.postgresql.org; Fri, 11 Nov 2022 07:22:00 +0000 Received: by mail-yb1-xb32.google.com with SMTP id j2so5046503ybb.6 for ; Thu, 10 Nov 2022 23:21:58 -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=dRBGLVcNo0mIxXg4v/9ylQZmq8g2jUwbzBtUd1U2z84=; b=jqM2CWIYqzWtZOZAlfU9ybnhxbGnZ/NVkJZMN8gSqq+JhIBSToaLBnWBxai6xnRvAG JH1IhLOBmtRMM9PXB+H8F5+uo6bYeEC1rMUYGxm0czyArkybEUTFyqsl+Tjnv2g4yjjC FcENRL+FoIdBxZEeDP9qlS0MRzZHZ/RIzF4bwk3um1VrpdQpfcPaxhsy+RuC+V7xhIe8 M9wzJEmOZOIDvp8tmymAsWjBRNbu7x897MJkGQU7XB2HdOsfvaF0FQAUy1cDPNyb6yVT YiG+eOrXQWURgLaMteZefogIx8P1UHKWT3pEpEIE+WqVnK+ia9SJUWaRBjwVtkDHi2Wn 4nFQ== 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=dRBGLVcNo0mIxXg4v/9ylQZmq8g2jUwbzBtUd1U2z84=; b=2jxkwkP3GAcNjkDiP9QhhU8qk+i/NyoUqlLc01+10e7e0XVNK+4ulIY6DEaInWH9dn C6KSPJ2oiiu3xPlAS5rwH4zffR8bh/uPbTeF4HG003e9L//lkko9dAHn8TYdSgcV5OPA /0em4oLXm7glfRPkioIeuVxgk6fHjcJp1F4B+EYNbxR7WAmyPrH7mygfriaz24MghZbo j7A9GHnLvc4LgbVlcOFgl7FyIR6NODrFb17EUxaDPJ/MDuDXOxjygSb84TPq3LTEjufB CKaBeHTJDEIOzBIuo7RMj3js6aAsi3b29lE7+WwMDVcdt6IYv831KhDoEbqqOnzgbaFZ gc8A== X-Gm-Message-State: ANoB5pmfRkw3dfnuJk09HilnMkYN68rcwcpJa0EfSDT2L34D8w/GM3uQ GNxxs8GDb+I8QAn9n7OvseYTCZ03cJokHChGX7Q= X-Google-Smtp-Source: AA0mqf6d6dE2OXxXgZXL7FVIiZj1BGsCFMNtbF/6PCmHRMhhcCFOr5y6oMxH1XNVgp7BA7jyZXHrIY3SD73MzL6QSbQ= X-Received: by 2002:a25:aacd:0:b0:6d0:997:9ac0 with SMTP id t71-20020a25aacd000000b006d009979ac0mr644582ybi.594.1668151317322; Thu, 10 Nov 2022 23:21:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Fri, 11 Nov 2022 12:51:45 +0530 Message-ID: Subject: Re: Perform streaming logical transactions by background workers and parallel apply To: "houzj.fnst@fujitsu.com" Cc: Masahiko Sawada , "wangw.fnst@fujitsu.com" , Peter Smith , Dilip Kumar , "shiy.fnst@fujitsu.com" , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Nov 11, 2022 at 7:57 AM houzj.fnst@fujitsu.com wrote: > > On Monday, November 7, 2022 6:18 PM Masahiko Sawada wrote: > > > > Here are comments on v42-0001: > > > > We have the following three similar name functions regarding to > > starting a new parallel apply worker: > > --- > > /* > > * Exit if any parameter that affects the remote connection > > was changed. > > - * The launcher will start a new worker. > > + * The launcher will start a new worker, but note that the > > parallel apply > > + * worker may or may not restart depending on the value of > > the streaming > > + * option and whether there will be a streaming transaction. > > > > In which case does the parallel apply worker don't restart even if the > > streaming option has been changed? > > Sorry, I forgot to reply to this comment. If user change the streaming option from > 'parallel' to 'on' or 'off', the parallel apply workers won't be restarted. > How about something like the below so as to be more explicit about this in the comments? diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index bfe326bf0c..74cd5565bd 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -3727,9 +3727,10 @@ maybe_reread_subscription(void) /* * Exit if any parameter that affects the remote connection was changed. - * The launcher will start a new worker, but note that the parallel apply - * worker may or may not restart depending on the value of the streaming - * option and whether there will be a streaming transaction. + * The launcher will start a new worker but note that the parallel apply + * worker won't restart if the streaming option's value is changed from + * 'parallel' to any other value or the server decides not to stream the + * in-progress transaction. */ -- With Regards, Amit Kapila.