Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbkWh-0006Fs-Bb for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Jun 2019 11:37:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkWg-0007KT-6V for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Jun 2019 11:37:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbkWf-0007KM-Oo for pgsql-hackers@lists.postgresql.org; Fri, 14 Jun 2019 11:37:45 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbkWc-0001hO-QT for pgsql-hackers@postgresql.org; Fri, 14 Jun 2019 11:37:44 +0000 Received: by mail-lj1-x242.google.com with SMTP id s21so2037927lji.8 for ; Fri, 14 Jun 2019 04:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=zsHnrVRxvv38iQ5avGFHo8L0HL8/RYQrI6enRpwmRJ0=; b=XUpVZKPhc9F+PtDMe0SHV/6HCwhY+V8SQGhtANiDz36vTQmcpIf1aeeMVQDaeTb5hd FcciByFvlqIb129v7vNkKtth954Rdqb9AFXjdPPGY7yGAJ9h+ObajL6+YliWGvSkAIff IP0pHoaiV2GALvD2IytdbnMHHzQLy1KryUP6z0ZeGulzov4UbRlVLkIq4Dps/xYuewaF Z+ru/N8sOCWTFEd9AwhSuuEIjcLveuV5H/xninsFgvlb8pU0NH885TKfOoavHWSbharv +zNqZ+Tyk5DyZPnfHMuUHeF62m7W0ZaPf/KKuO21vvdDHA2CLu8K6x1zhj3Gv1ydxqt7 DYXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=zsHnrVRxvv38iQ5avGFHo8L0HL8/RYQrI6enRpwmRJ0=; b=TSig9Aedzyxl2WEDTRMRWdG5HJWOg5qhxPzhjxCyHk2iiP1K+zBYTldK8X0Q7UABEn 8NS1jqEvdR/7GKUZKgpXlNWYE3DSxRGI6fbdX7a45RWPl662BcjPr5D5JyXt7lMCcLUH I+LGFdE7woveKNO2hFs4B3V+B4wTmPp2Vt00tm6EzS28FXQeTfrXej2qLVp61o8PG35M 5enQOPv0ezQZG0x+hF5PJ6IFLBdCIgD6jhA/fDv4iuIscIwma2lH5s/Gb9xkpyWiqyJb LURhukqV4z6/eQf4L+RRz8/No+R0z4Y2J20GX5xJmUCvZkGcPR+tMsT5LZBt21acHtKP RxzQ== X-Gm-Message-State: APjAAAVFVkHNjK1/nSjjdYV9brXdZCXHmKgtdIXdKK/y2lML2j9i/C3F KhWyuzo6VAZmo9J21MpMrifEQwf79eM0z5GZ7b7DGA== X-Google-Smtp-Source: APXvYqx/iYzjsR6yqCOK0UL6uenfNSj2G4mKcnobgsV8s6h3jkp6n9W/G+AB0UcQ5qnvc30lXNK4dSHrN1NiRQjm5JE= X-Received: by 2002:a2e:9685:: with SMTP id q5mr2422934lji.227.1560512261065; Fri, 14 Jun 2019 04:37:41 -0700 (PDT) MIME-Version: 1.0 References: <20190523160023.cpi7cyozbthflx32@alap3.anarazel.de> <20190611183650.GA25310@alvherre.pgsql> In-Reply-To: <20190611183650.GA25310@alvherre.pgsql> From: Amit Khandekar Date: Fri, 14 Jun 2019 17:07:05 +0530 Message-ID: Subject: Re: Minimal logical decoding on standbys To: Alvaro Herrera Cc: Andres Freund , Robert Haas , Sergei Kornilov , tushar , Petr Jelinek , Craig Ringer , Petr Jelinek , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 12 Jun 2019 at 00:06, Alvaro Herrera wro= te: > > On 2019-May-23, Andres Freund wrote: > > > On 2019-05-23 09:37:50 -0400, Robert Haas wrote: > > > On Thu, May 23, 2019 at 9:30 AM Sergei Kornilov wrote: > > > > > wal_level is PGC_POSTMASTER. > > > > > > > > But primary can be restarted without restart on standby. We require= wal_level replica or highter (currently only logical) on standby. So onlin= e change from logical to replica wal_level is possible on standby's control= file. > > > > > > That's true, but Amit's scenario involved a change in wal_level durin= g > > > the execution of pg_create_logical_replication_slot(), which I think > > > can't happen. > > > > I don't see why not - we're talking about the wal_level in the WAL > > stream, not the setting on the standby. And that can change during the > > execution of pg_create_logical_replication_slot(), if a PARAMTER_CHANGE > > record is replayed. I don't think it's actually a problem, as I > > outlined in my response to Amit, though. > > I don't know if this is directly relevant, but in commit_ts.c we go to > great lengths to ensure that things continue to work across restarts and > changes of the GUC in the primary, by decoupling activation and > deactivation of the module from start-time initialization. Maybe that > idea is applicable for this too? We do kind of handle change in wal_level differently at run-time versus at initialization. E.g. we drop the existing slots if the wal_level becomes less than logical. But I think we don't have to do a significant work unlike how it seems to have been done in ActivateCommitTs when commit_ts is activated. > > -- > =C3=81lvaro Herrera https://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Thanks, -Amit Khandekar EnterpriseDB Corporation The Postgres Database Company