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 1gt3uv-0003HG-S1 for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Feb 2019 05:14:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gt3us-0004wX-SP for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Feb 2019 05:14:02 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1gt3us-0004wQ-LG for pgsql-hackers@lists.postgresql.org; Mon, 11 Feb 2019 05:14:02 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gt3um-0001pz-37 for pgsql-hackers@postgresql.org; Mon, 11 Feb 2019 05:14:01 +0000 Received: by mail-pf1-x42e.google.com with SMTP id y126so4727317pfb.4 for ; Sun, 10 Feb 2019 21:13:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Xt02aOcNK0aI5RamtROnmtA5yO/ZWMzNmOUiPVAcX8M=; b=dv2V3jTc6EbTj2a4xLrV0VXWmnF4LH242xxqzLCSX4xY0JPaVBVdrEEzCEWJsZFZa0 vaa8ltD4wexpv4pak4JSz4KptAhapbXBMB9Q5P49dAE/FhPJYOtB4dXiJIrIh4LRRRpt 0BBtYvp6ES5i6qmfR3lQ5o+Tjk5U7OuxK8vXU= 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:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Xt02aOcNK0aI5RamtROnmtA5yO/ZWMzNmOUiPVAcX8M=; b=pUPAFWn4QnBDWSBEk43uEtaDgbFhoc7tvzu7l1g1tjAi2oOLSHkcG27dQVg2rA1Yp7 XETP4BWKpZ4wxMREki6GyJBSKZhQy69KGjam2o7j493oOa0R/XwX1cn5zwhjbBd4rAn3 YXuhcCpuUOv1PTjYpT9n5Y5xoXL1XDjy4Q3Zu1Qcnv3eqo4RdASUC3vcnlWdz70v7I8h 1bZzK7xn9pHNxdNSqq7Zpv6eQfxiXuXc3l9/tE77XsNTKn+QVTpvPR5NRzXrDtYd6JpX jwKy3mU9zNEQgBziR33gnNZyQeW3f5ej9XK1XFdFKq3oOmgyuF6LUQQCv9npALi6cKo1 PRvg== X-Gm-Message-State: AHQUAubi+n8hxdXU4sqYhwR+39HX9f637qm2wKx9IWcFOYiFZknaC2AQ 2eoN8absdjduTX+rwtp6jVGjge0W6yk= X-Google-Smtp-Source: AHgI3IY9G13jhNbRhop22lENTQDQnwS5+Szz5HCE1Xv0YP1nHxj9YH/AqPZNxPCbyVIpgUkct7ATuQ== X-Received: by 2002:a63:9348:: with SMTP id w8mr10982679pgm.198.1549862032891; Sun, 10 Feb 2019 21:13:52 -0800 (PST) Received: from rfd.leadboat.com (108-233-125-46.lightspeed.sntcca.sbcglobal.net. [108.233.125.46]) by smtp.gmail.com with ESMTPSA id f62sm11779140pgc.67.2019.02.10.21.13.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 21:13:51 -0800 (PST) Date: Sun, 10 Feb 2019 21:13:49 -0800 From: Noah Misch To: pgsql-hackers@postgresql.org Subject: Re: Spurious "apparent wraparound" via SimpleLruTruncate() rounding Message-ID: <20190211051349.GA952299@rfd.leadboat.com> References: <20190202083822.GC32531@gust.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190202083822.GC32531@gust.leadboat.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Feb 02, 2019 at 03:38:22AM -0500, Noah Misch wrote: > The main consequence is the false alarm. A prudent DBA will want to react to > true wraparound, but no such wraparound has occurred. Also, we temporarily > waste disk space in pg_xact. This feels like a recipe for future bugs. The > fix I have in mind, attached, is to change instances of > ctl->PagePrecedes(FIRST_PAGE_OF_SEGMENT, ROUNDED_cutoffPage) to > ctl->PagePrecedes(LAST_PAGE_OF_SEGMENT, cutoffPage). I'm inclined not to > back-patch this; does anyone favor back-patching? To avoid wasting more of anyone's time: that patch is bad; I'll update this thread when I have something better.