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 1pY3gh-0006Er-Kl for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Mar 2023 11:35:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pY3gg-0004rr-0a for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Mar 2023 11:34:58 +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 1pY3gf-0004ri-Jw for pgsql-hackers@lists.postgresql.org; Fri, 03 Mar 2023 11:34:57 +0000 Received: from lahtoruutu.iki.fi ([2a0b:5c81:1c1::37]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY3gd-0002cJ-2H for pgsql-hackers@postgresql.org; Fri, 03 Mar 2023 11:34:57 +0000 Received: from [192.168.1.113] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4PSm980Qdcz49Q4s; Fri, 3 Mar 2023 13:34:51 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1677843293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K/lG0cH+ai1FO/hOl2M5DnNYPbObwYIdHTm/O/8LrAI=; b=SLDCllsABr+4BKvtEiaqixCgHl1mrMVwKF3ZHytR9Cu9XD3Ezi95M/OI9Q5/EIxQvcViAd 4NHD83lfbOdyOLR8+ZjIexbtJe3+r6LiJhQGpJkBu0ucKXIBQ/eUYYsUuvo1JxnQl97Mkj N2CBNy8JKMAi9SPJLLO3xYVCJu9UCt80kOjw6QdYcbb1l9++59IV2EklhIXanvk/8239gK Sn7c870w6fG9nmYVKIy2tvh+qgxkwaVocuH6GdQy1Fqba7t6n9CsN8Q7GzwpcbVw07di0E BXRtXVVYljvCbjgPPIO170SWzrZie/bX1Ch5QqN04dHShY1bbQ6rOW191uJObA== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1677843293; a=rsa-sha256; cv=none; b=UVlK6ZX5GB4MGJP+IC56UkS6HhTjn2f7VrxjfKgj0CdljeUw1Q9Y2UQFk6TuITpv4IyvZG AyxBwZskk1g1urOUCb+T+cG8aZW/ilQSDzdnaL45KjBSv+106eFzgyEKTkV6uE6CrHcA/C KshNolpL4k6O64WbqTX7PECJDVnomxz57zWK9b1t5hMD6bPFr27cIsXZ3TUbkt4NANtC15 I3sNY8vBdOX64J2Wud8OKzUz3yFGwEuGGGZ0SKN4B+s3XokJ5nfQ4UlV9CBK8QMG0y2IC6 t7tfN7YaX6CQRa9yp4SjlE9UlxSrBXE0NaQ/mK3bDhwHx7SRvE5TUEKk/R8HaA== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1677843293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K/lG0cH+ai1FO/hOl2M5DnNYPbObwYIdHTm/O/8LrAI=; b=N6ThvV/4J7gRjvD58qp1fPAY7nUkVA7QnBfHl/LGGQIOQPIPxJ9Qarju4Rxs5EznKHOxq3 cYIxG7Jwjf7mhvSWIhobq6VfRY2TYSWTiBZR0iOeGO3MDMeUNkIh4DqQyy22u+NjCFKKxQ IuYQamKB2HusAtpWyNDfo49qvKP7i+TGizwf5xmnaO13XGQPnJgDhnUGNUqq5U4NW+O9JB jdp493wAUpN00bvwX6zZy20pgghwZf0LvomqzPBTaHU3uPNW1ZjuQlYW7LstYNBAnz95dO OXdBqH+xkwsQYf9fFyOY17RpVMoXP/7BhC28XM2i79SAbhx5xfhdrhCwbFpr3A== Message-ID: <64524348-b10e-9904-4858-8fe62d058b14@iki.fi> Date: Fri, 3 Mar 2023 13:34:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: Testing autovacuum wraparound (including failsafe) Content-Language: en-US To: Ian Lawrence Barwick , Masahiko Sawada Cc: Andres Freund , Anastasia Lubennikova , pgsql-hackers , Peter Geoghegan References: <20210423204306.5osfpkt2ggaedyvy@alap3.anarazel.de> <20210611011850.detxnd7bnffg3daz@alap3.anarazel.de> From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 16/11/2022 06:38, Ian Lawrence Barwick wrote: > Thanks for the patch. While reviewing the patch backlog, we have determined that > the latest version of this patch was submitted before meson support was > implemented, so it should have a "meson.build" file added for consideration for > inclusion in PostgreSQL 16. I wanted to do some XID wraparound testing again, to test the 64-bit SLRUs patches [1], and revived this. I took a different approach to consuming the XIDs. Instead of setting nextXID directly, bypassing GetNewTransactionId(), this patch introduces a helper function to call GetNewTransactionId() repeatedly. But because that's slow, it does include a shortcut to skip over "uninteresting" XIDs. Whenever nextXid is close to an SLRU page boundary or XID wraparound, it calls GetNewTransactionId(), and otherwise it bumps up nextXid close to the next "interesting" value. That's still a lot slower than just setting nextXid, but exercises the code more realistically. I've written some variant of this helper function many times over the years, for ad hoc testing. I'd love to have it permanently in the git tree. In addition to Masahiko's test for emergency vacuum, this includes two other tests. 002_limits.pl tests the "warn limit" and "stop limit" in GetNewTransactionId(), and 003_wraparound.pl burns through 10 billion transactions in total, exercising XID wraparound in general. Unfortunately these tests are pretty slow; the tests run for about 4 minutes on my laptop in total, and use about 20 GB of disk space. So perhaps these need to be put in a special test suite that's not run as part of "check-world". Or perhaps leave out the 003_wraparounds.pl test, that's the slowest of the tests. But I'd love to have these in the git tree in some form. [1] https://www.postgresql.org/message-id/CAJ7c6TPKf0W3MfpP2vr=kq7-NM5G12vTBhi7miu_5m8AG3Cw-w@mail.gmail.com) - Heikki