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 1hF1q7-00083u-EN for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Apr 2019 19:27:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hF1q6-0003Ct-91 for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Apr 2019 19:27:54 +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 1hF1q5-00039V-Rb for pgsql-hackers@lists.postgresql.org; Fri, 12 Apr 2019 19:27:53 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hF1q3-00088V-CY for pgsql-hackers@postgresql.org; Fri, 12 Apr 2019 19:27:52 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8619F21D51; Fri, 12 Apr 2019 15:27:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 12 Apr 2019 15:27:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=QsLCeyLiQ4NNOIKxoZyOnIHmf9W uiBbVgoxrBtyfsDM=; b=Uqmh2LtboAg4frlYkQRQG1EZPqb02Z06QDzwxGbG1om QbY861Nro7Hyx56XdwSoATYC70IUEK3pMMj9+XeTPACO3NJEUw95qjhAvIyjjzPP hw9fz2iR/mJc0qhKpCg8TGNYspSn6k5aatluLPm6VKRL+YHZpBAE1SsgabYrBjHc dHvkE6vcJCz+FUaJaXJD8gkU1Y4iXppYhh6KPDb4TtmtSkJuQzu/72Gkl59yPhL9 FQvfA1NoCB002QDlNJx1iC2mSVqwGHAUg5p++bjG9VZuV459C/sKKBVeGjAlrCMI Y3tdJ/81Pz/ATyMzXjPxVFg60ljc5/gHZN1KFPZpO6A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=QsLCey LiQ4NNOIKxoZyOnIHmf9WuiBbVgoxrBtyfsDM=; b=d2uxnOkyD6mjH9HRGBdTQ3 HUB/jYl1IsVELLQwQyHxMrUBP5LtophclNNlB9EeJpWnI+QZMPxqfWylg4VCDo5m tD+QL7PzE6GxKLwnI7TWSkiOScopTbHd3VqsLTq78utEFhKQAtP8meO78AaTyi4D RYHwEd3pM82c+Xei8V7pdqqB542b+Mf4sa17YNhulS4o7Y2EDCrQDQASJWHfsdha IPwv9AO168oCEyPY28HbezCjhHl/4IKJhTa9sXk4DH/63nt95MSpYl0KqdW8L+pp Hmx+hQIYKtKb857sqMe9CQeS6WXwgfQ51tnvQlBZkRNy9LFhQ+djv3XAEzWKl3lw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrvddugdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkpheple ekrddvuddtrddugedtrddujedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgv shesrghnrghrrgiivghlrdguvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 6AC4110310; Fri, 12 Apr 2019 15:27:49 -0400 (EDT) Date: Fri, 12 Apr 2019 12:27:47 -0700 From: Andres Freund To: Amit Khandekar Cc: tushar , Petr Jelinek , Robert Haas , Craig Ringer , Petr Jelinek , pgsql-hackers Subject: Re: Minimal logical decoding on standbys Message-ID: <20190412192747.m73h2qnddrpzefij@alap3.anarazel.de> References: <7e905539-7fdc-6b29-5a56-ba48d180fef8@2ndquadrant.com> <20190301174628.rjzoi7arvci5ldcm@alap3.anarazel.de> <20190304172739.hdkwmtngwx5444un@alap3.anarazel.de> <9fce660d-47fc-4294-3084-3769e543da8a@enterprisedb.com> <53656d0c-1868-86e8-54a6-216ce74b353a@enterprisedb.com> <8af22fc0-d08c-f3fa-e7ec-dfb153b3d7b4@enterprisedb.com> <20190410160925.c4sat4ex67blinhy@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-04-12 23:34:02 +0530, Amit Khandekar wrote: > I tried to see if I can quickly understand what's going on. > > Here, master wal_level is hot_standby, not logical, though slave > wal_level is logical. Oh, that's well diagnosed. Cool. Also nicely tested - this'd be ugly in production. I assume the problem isn't present if you set the primary to wal_level = logical? > Not sure why this is happening. On slave, wal_level is logical, so > logical records should have tuple data. Not sure what does that have > to do with wal_level of master. Everything should be there on slave > after it replays the inserts; and also slave wal_level is logical. The standby doesn't write its own WAL, only primaries do. I thought we forbade running with wal_level=logical on a standby, when the primary is only set to replica. But that's not what we do, see CheckRequiredParameterValues(). I've not yet thought this through, but I think we'll have to somehow error out in this case. I guess we could just check at the start of decoding what ControlFile->wal_level is set to, and then raise an error in decode.c when we pass an XLOG_PARAMETER_CHANGE record that sets wal_level to something lower? Could you try to implement that? Greetings, Andres Freund