Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fj8Nm-00031s-RV for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Jul 2018 19:26:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fj8Nl-0002TO-39 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Jul 2018 19:26:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fj8Nk-0002TH-Nn for pgsql-hackers@lists.postgresql.org; Fri, 27 Jul 2018 19:26:32 +0000 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fj8Ng-0000nL-Da for pgsql-hackers@postgresql.org; Fri, 27 Jul 2018 19:26:31 +0000 Received: by mail-qt0-x242.google.com with SMTP id t5-v6so6195163qtn.3 for ; Fri, 27 Jul 2018 12:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=efOaxh1/Y4wlAzAvsaWERkaToVaPBKm+EZrNH/d0I74=; b=R5LDU78LwFFJ9k95nzPnHUKQyltmBwZY0dIWVquqZayOJ4odj0naOQiWT9YtNZTIYy RDmrlWBphw3gTGfpSD8SqLEQHXcyHc8V7KAfyC4t2mOOB5IyvxFIhW54N7G7UkLB7z97 SvkMEx+RRVKrEtUvoChpAKvUjbtk37ZbT2HJSYsIQGs2AFd62UFiFvkJaN/ajQswT2P0 qOlOXfTyQXGEYGiso+i9j2JRFXoYv8bI8St748YsGntChVMxt+Vw+Oc98KAHTvtZqtEr 4YjeWY84fWhXoxy1gGW52wZB3a0rjq5whif36wHp0kT+QjoWNA8NVIRwFfjHFaf8AA6c fO2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=efOaxh1/Y4wlAzAvsaWERkaToVaPBKm+EZrNH/d0I74=; b=GVHZUqNDIl7CYLTwL2qMcWXMH1kJ1nHdKIXnQCVO3MA41KBaXZtVjW+9PUopalEF2m iHBp2jaXPWZYC8VpjwDCTmZjBIRQS7htbOf2A94nTbIMZYrHuFvHaeCTVVP7pEenaMVV xTlxVlgEUeX45dZk61qoGG1hWobSE0TzKgTXcMJ7stMlcsxYqE8Q5gSLlwp6yddkbdVf GyTVsH1UwN60saEAK8VoGnWo++9mV944oYSZi+AQQuchM8eIc8G5TIFTTbI64iWKbcQS /iQQAbqGBdhaqIR59GR9rEPFLHKW3xytCae+owU4SKEh0F9EIUn22qbx+IAKcBkb9Ijc jpMA== X-Gm-Message-State: AOUpUlE9J1kxQSSih23OOimYhrRxoivGKiBgpfS/htjWGcChquE1Zoac Mgqi3i5TCBTFA7iSZnerZdmntdjmSK/SpU+NiiOF+AR2Gw0mxfahbmQmPCkV/f631N3d/fSJaHc ZYM73rqso8w/sG9+haoEzRu4PTTSdPoGofgTX5Z+vsII1kkU5nMnXubY5D6T3EYcIreuKgFEAzz o0So5XRU8gj/z1 X-Google-Smtp-Source: AAOMgpcZOOuXNhjHINaiR6PbbcvpSlF65dO9O5vXCvDEk6+kFmS2RpGkSNKnsfegF5Y314ggV5Khqg== X-Received: by 2002:ac8:17ee:: with SMTP id r43-v6mr7667439qtk.106.1532719585569; Fri, 27 Jul 2018 12:26:25 -0700 (PDT) Received: from [192.168.10.146] ([98.122.175.38]) by smtp.gmail.com with ESMTPSA id k38-v6sm3012671qtc.45.2018.07.27.12.26.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 12:26:24 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: [HACKERS] WAL logging problem in 9.4.3? To: Heikki Linnakangas , Robert Haas , Michael Paquier Cc: "pgsql-hackers@postgresql.org" References: <20180704045912.GG1672@paquier.xyz> <20180711033241.GQ1661@paquier.xyz> <08b11907-d0b2-c396-2978-ba5aac1972df@iki.fi> <026AD6A1-3396-47F4-B87E-77E3F139D166@iki.fi> <20180717000129.GA3388@paquier.xyz> <3c1cf991-8846-9a6f-c669-e21f8ea9a6a4@2ndQuadrant.com> <20180718130622.GI8565@paquier.xyz> Message-ID: Date: Fri, 27 Jul 2018 15:26:24 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-MW List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07/18/2018 10:58 AM, Heikki Linnakangas wrote: > On 18/07/18 16:29, Robert Haas wrote: >> On Wed, Jul 18, 2018 at 9:06 AM, Michael Paquier >> wrote: >>>> What's wrong with the approach proposed in >>>> http://postgr.es/m/55AFC302.1060805@iki.fi ? >>> >>> For back-branches that's very invasive so that seems risky to me >>> particularly seeing the low number of complaints on the matter. >> >> Hmm. I think that if you disable the optimization, you're betting that >> people won't mind losing performance in this case in a maintenance >> release.  If you back-patch Heikki's approach, you're betting that the >> committed version doesn't have any bugs that are worse than the status >> quo.  Personally, I'd rather take the latter bet.  Maybe the patch >> isn't all there yet, but that seems like something we can work >> towards.  If we just give up and disable the optimization, we won't >> know how many people we ticked off or how badly until after we've done >> it. > > Yeah. I'm not happy about backpatching a big patch like what I > proposed, and Kyotaro developed further. But I think it's the least > bad option we have, the other options discussed seem even worse. > > One way to review the patch is to look at what it changes, when > wal_level is *not* set to minimal, i.e. what risk or overhead does it > pose to users who are not affected by this bug? It seems pretty safe > to me. > > The other aspect is, how confident are we that this actually fixes the > bug, with least impact to users using wal_level='minimal'? I think > it's the best shot we have so far. All the other proposals either > don't fully fix the bug, or hurt performance in some legit cases. > > I'd suggest that we continue based on the patch that Kyotaro posted at > https://www.postgresql.org/message-id/20180330.100646.86008470.horiguchi.kyotaro%40lab.ntt.co.jp. > I have just spent some time reviewing Kyatoro's patch. I'm a bit nervous, too, given the size. But I'm also nervous about leaving things as they are. I suspect the reason we haven't heard more about this is that these days use of "wal_level = minimal" is relatively rare. I like the fact that this is closer to being a real fix rather than just throwing out the optimization. Like Heikki I've come round to the view that something like this is the least bad option. The code looks good to me - some comments might be helpful in heap_xlog_update() Do we want to try this on HEAD and then backpatch it? Do we want to add some testing along the lines Michael suggested? cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services