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 1iqFpK-0002Oq-Um for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jan 2020 12:25:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iqFpJ-0003up-GD for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jan 2020 12:25:13 +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 1iqFpJ-0003pN-0d for pgsql-hackers@lists.postgresql.org; Sat, 11 Jan 2020 12:25:13 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iqFpB-0006zu-JP for pgsql-hackers@postgresql.org; Sat, 11 Jan 2020 12:25:11 +0000 Received: by mail-wm1-x343.google.com with SMTP id u2so4723897wmc.3 for ; Sat, 11 Jan 2020 04:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rjfD2v7Ex/W/ixvW8W0C/56RUzCleZmd9B3qAe4/Sr8=; b=vPOY86tv845wpgpzYqUTsNncMl4G5LP2V9jtlAQ2JWrtag+mbMfqRNGAmt9ZMCvMTr Pirjkx5m1z99tOULG+oXaFEW9yFU9Tei36J4jQHjaW5j9Rd8udNOLCQ31Q7vwZiHNqZb TeJwPv26dohOrgBaSIIsVyDU4gOyrQ1RhnDEiei2OLuz5I009HxER66m84cAOOt/JWk+ 28CwpbRrGbs1FXQXD0aeTuXWOaB2BDyNqDl06nWcl2sEY2zuQ21eLdokcrd8On+0fI5i JBJo1jVRZ50mJ1klFxtXb2pFNErzvx5CawumWF7omKBy2x3dN4TIjt8XzB4QSmZ6m0l+ Qq3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rjfD2v7Ex/W/ixvW8W0C/56RUzCleZmd9B3qAe4/Sr8=; b=Y/w3XL+0fk1Cw7QLYbF5WKW5XaEs5mIPg28GVVBJMsuVA0j1lPAic4EOO01W7ovXAk 3Xr8SnanUQ4ydeUvMjnPuXx3y66VIx27VkxYIegXXFMDUPsUnDMS8YM/a4/eN3QkK3Zh LFTC1LG8QHnkzEKmTEI9Ixh9A5WZRE8pwx91B5f/XCYL9NOojcm1TQIYn6QtioZfXMED sjTuPfAm0jlotD2J9lQ7k0NnZURWV9ewp4YY2aq8xh9X6LewRx1QN99S10awfr3fWYih wWlyILGbZVjZgVFZo2UCcyhJiXwm/HDe4HMprwuzfyiBcMTUhUKN+zgHlOtIS3hGrStW eXCg== X-Gm-Message-State: APjAAAVjFn51F07in826Nz+10OMTvpfYxp45jFTiIzkyAWNIu+0X4Tey EgsXcQwJy6+Cft/4tsrRRYF2rA== X-Google-Smtp-Source: APXvYqzTV7fp0gd1x0JdPzFbg6OC8hCmgILYNzCxTAKz34+7jTmv2SRNuT6f3kzUUNcZr+P01+w6LQ== X-Received: by 2002:a7b:c847:: with SMTP id c7mr9843147wml.3.1578745503306; Sat, 11 Jan 2020 04:25:03 -0800 (PST) Received: from localhost (ip-86-49-253-92.net.upcbroadband.cz. [86.49.253.92]) by smtp.gmail.com with ESMTPSA id v83sm6175849wmg.16.2020.01.11.04.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jan 2020 04:25:02 -0800 (PST) Date: Sat, 11 Jan 2020 13:25:01 +0100 From: Tomas Vondra To: Peter Geoghegan Cc: Alvaro Herrera , Andrey Borodin , PostgreSQL Hackers Subject: Re: Amcheck: do rightlink verification with lock coupling Message-ID: <20200111122501.rhpxt5f44jlnee5u@development> References: <0EB0CFA8-CBD8-4296-8049-A2C0F28FAE8C@yandex-team.ru> <20190912131612.GA24926@alvherre.pgsql> <20200111014538.y4u6fynjeha2nml6@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Jan 10, 2020 at 06:49:33PM -0800, Peter Geoghegan wrote: >On Fri, Jan 10, 2020 at 5:45 PM Tomas Vondra > wrote: >> Peter, any opinion on this proposed amcheck patch? In the other thread >> [1] you seemed to agree this is worth checking, and Alvaro's proposal to >> make this check optional seems like a reasonable compromise with respect >> to the locking. > >It's a good idea, and it probably doesn't even need to be made >optional -- lock coupling to the right is safe on a primary, and >should also be safe on standbys (though I should triple check the REDO >routines to be sure). The patch only does lock coupling when it proves >necessary, which ought to only happen when there is a concurrent page >split, which ought to be infrequent. Maybe there is no need to >compromise. > OK, that makes sense. >I'm curious why Andrey's corruption problems were not detected by the >cross-page amcheck test, though. We compare the first non-pivot tuple >on the right sibling leaf page with the last one on the target page, >towards the end of bt_target_page_check() -- isn't that almost as good >as what you have here in practice? I probably would have added >something like this myself earlier, if I had reason to think that >verification would be a lot more effective that way. > >To be clear, I believe that Andrey wrote this patch for a reason -- I >assume that it makes a noticeable and consistent difference. I would >like to gain a better understanding of why that was for my own >benefit, though. For example, it might be that page deletion was a >factor that made the test I mentioned less effective. I care about the >specifics. > Understood. Is that a reason to not commit of this patch now, though? regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services