Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tT6xL-003Ql3-Mx for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jan 2025 22:12:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tT6xJ-00ANP6-K5 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jan 2025 22:12:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tT6xJ-00ANOy-AA for pgsql-hackers@lists.postgresql.org; Wed, 01 Jan 2025 22:12:45 +0000 Received: from meesny.iki.fi ([2001:67c:2b0:1c1::201]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tT6xF-002j9Q-S5 for pgsql-hackers@lists.postgresql.org; Wed, 01 Jan 2025 22:12:44 +0000 Received: from [IPV6:2001:14bb:c4:18a8:ac92:3217:371a:3] (unknown [IPv6:2001:14bb:c4:18a8:ac92:3217:371a:3]) (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 meesny.iki.fi (Postfix) with ESMTPSA id 4YNkbq1SQkzyVQ; Thu, 2 Jan 2025 00:12:39 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1735769559; 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=1ywHbLi//VUdkn+TtVlP7DDGOwVHobdJ2UZHduoGQlY=; b=uhSvMHd50/Kp2e4uIXFcbB7SpbuhW3CDMwTNww2LhmKf37Vc7/TwqXNbW+AwOr97nt1MDW 3pOlaqaDQ17FcjCqTzw2H9JibT+WnLyylLMu1jg+oQ3yFv3SWL6scL4Q7btZsLlYXjR1tx HUe+gNv0zJAZXmdEEk8u8F2R7nOczMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1735769559; 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=1ywHbLi//VUdkn+TtVlP7DDGOwVHobdJ2UZHduoGQlY=; b=yNWc1a75gWQ37YPi6RjXUcQU+7PwjF6tAapQ9V2odtw1wC9ddoIRvUuF/AfQV4Yuu3i8Wf JCSID7kfuaP6hsivUGCkJAjuiSsjiygzsVHOCyZc3SPH932VAyg8AxXY2jVLGBE3YqL6ib tL9yC0WQdqCLnwhPHDnZ40b3BBwFPD4= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1735769559; a=rsa-sha256; cv=none; b=qjFJzb/JGWKKL1cnYYbLFCqHSvxuSE6ToPzSyycNhSq+hYtjSqdGDAo0SQsXAbBVPVqsb2 otsyaUNFUmnRxYHR6ltdX3dgLR/nD2NH5C3jHiqT40jiOO12POG6bTEoN9DpkF8wYAHjpV RFmwpfVooOn+Zc/ww2owgUN/WFsES8E= Message-ID: <2bc58592-9d74-4af0-bdd1-1a88e8683f7c@iki.fi> Date: Thu, 2 Jan 2025 00:12:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: POC: make mxidoff 64 bits To: Maxim Orlov Cc: wenhui qiu , Alexander Korotkov , Postgres hackers References: <5ecc35f5-1111-47fc-8a02-36d89490a50d@iki.fi> <24b3deb6-a732-4256-847a-560f4bf39d59@iki.fi> <4535f3aa-3220-4760-b1f5-2bc91f248e03@iki.fi> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 27/12/2024 19:09, Maxim Orlov wrote: > > On Wed, 18 Dec 2024 at 13:21, Heikki Linnakangas > wrote: > Does the pg_upgrade code work though, if you have that buggy situation > where oldestOffsetKnown == false ? ... > > > >               if (!TransactionIdIsValid(*xactptr)) > >               { > >                       /* Corner case 3: we must be looking at > unused slot zero */ > >                       Assert(offset == 0); > >                       continue; > >               } > > After upgrade, this corner case 3 would *not* happen on offset == 0. So > looks like we're still missing test coverage for this upgrade corner > case. > > Am I understanding correctly that you want to have a test corresponding > to the buggy 9.3 and 9.4 era versions? No, those were two different things. I think there might be two things wrong here: 1. I suspect pg_upgrade might not correctly handle the situation where oldestOffsetKnown==false, and 2. The above assertion in "corner case 3" would not hold. It seems that we don't have a test case for it, or it would've hit the assertion. Now that I think about it, yes, a test case for 1. would be good too. But I was talking about 2. > Do you think we could imitate this scenario on a current master branch > like that: > 1) generate a couple of offsets segments for the first table; > 2) generate more segments for a second table; > 3) drop first table; > 4) stop pg cluster; > 5) remove pg_multixact/offsets/0000 > 6) upgrade? I don't remember off the top of my head. It might be best to just refuse the upgrade if oldestOffsetKnown==false. It's a very ancient corner case. It seems reasonable to require you to upgrade to a newer minor version and run VACUUM before upgrading. IIRC that sets oldestOffsetKnown. -- Heikki Linnakangas Neon (https://neon.tech)