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 1jYzag-0002au-NK for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 22:11:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYzae-0004bg-PR for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 22:11:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYzae-0004Uz-C4 for pgsql-hackers@lists.postgresql.org; Wed, 13 May 2020 22:11:00 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jYzaa-0006jg-Kf for pgsql-hackers@postgresql.org; Wed, 13 May 2020 22:10:59 +0000 Received: by mail-qk1-x744.google.com with SMTP id n14so1047312qke.8 for ; Wed, 13 May 2020 15:10:56 -0700 (PDT) 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:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=EbH67KCrDfTmewabdlszrcdX5PsFGtCiAKPcsX+iYfY=; b=jlTVqcmkKrVog7hRY44+NXG2Z/DqmkbqcezUj7DiPvWYfiWerYjbCTuutSxEhHpUUb xDFKCNyIMg/F2vjoFjmIhQNg+wG1zRuehMq+JBWK2SMjnxH6keGMDaC9dvK/HLfItAg+ 9K2DeilKinHOXrGVEuM5x4LSPXksmi88wn40VVBnz+5WMNfjz4NkuFUbQed0pMfykDs2 UP83vp/vg69rZ5INP0B+3xm/oi+OsxkWJj93URqUZxBDnowHCNNaMasOON1f+mgQ1BJF Zd6rUn5exmvWmGT6qyCr9dDdMLcOpCAxKG/cH5bKVLRQ0BsAWwdgQKXWbmMVOfDY8qw8 EhEQ== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=EbH67KCrDfTmewabdlszrcdX5PsFGtCiAKPcsX+iYfY=; b=lM6pWnKo8S2dZFz0766s8CO4KaalTP5veg/EdFRNFGr3W7WMle4/1+ucXRHPv8qlaD d2m7fNKjffrEvf0zDFWOACrXYTfwT6fZvGdaBfhTvioRcds0twbxFbeE+m1hoED7VrOZ nOXs64Kuo8HYj1/EC8gOGFMrwvAABSNNghtj+jOO5xl7HDEUANa9eirHSPumu8+CvGmV 534LXe7fCvCdxb2fYK5HkAJhEdd27PX80bqke8y4WgHVLWwk67pHpG5fL41b9D+k/GGL CJ9H03iWEAo0Fh/3UxTg1KjjN37DOs8iN3dv98mrRcTTVTUwi8dNmxUapIM3dhEaFmZH 95Zw== X-Gm-Message-State: AOAM53158MaZL3IipSz8FcbD9h5ptMUYWc6pm4K4/T0HZEDs1ia3eo4H Ss1RdWD9Q9pbSHANltB0yW82MQ== X-Google-Smtp-Source: ABdhPJyFzzv4OKQKWKzM+wTSFTDaSXzJOEFZDjxc1H3b4ifg7h888biMaA4XRXrr5cr5+Qe32YlOYw== X-Received: by 2002:a05:620a:6b7:: with SMTP id i23mr1901861qkh.156.1589407853903; Wed, 13 May 2020 15:10:53 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id n8sm976534qtn.12.2020.05.13.15.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 15:10:53 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 785C7300689; Wed, 13 May 2020 18:10:51 -0400 (-04) Date: Wed, 13 May 2020 18:10:51 -0400 From: Alvaro Herrera To: Peter Geoghegan Cc: Mark Dilger , Robert Haas , Andres Freund , PostgreSQL-development Subject: Re: new heapcheck contrib module Message-ID: <20200513221051.GA26592@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-May-12, Peter Geoghegan wrote: > > The point is that when checking the table for corruption I avoid > > calling anything that might assert (or segfault, or whatever). > > I don't think that you can expect to avoid assertion failures in > general. Hmm. I think we should (try to?) write code that avoids all crashes with production builds, but not extend that to assertion failures. Sticking again with the provided example, > I'll stick with your example. You're calling > TransactionIdDidCommit() from check_tuphdr_xids(), which will > interrogate the commit log and pg_subtrans. It's just not under your > control. in a production build this would just fail with an error that the pg_xact file cannot be found, which is fine -- if this happens in a production system, you're not disturbing any other sessions. Or maybe the file is there and the byte can be read, in which case you would get the correct response; but that's fine too. I don't know to what extent this is possible. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services