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 1uqpJj-00Djpo-A4 for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Aug 2025 08:46:12 +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 1uqpJg-003XVM-Jq for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Aug 2025 08:46:09 +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 1uqpJg-003XSE-89 for pgsql-hackers@lists.postgresql.org; Tue, 26 Aug 2025 08:46:08 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uqpJc-001v7r-1b for pgsql-hackers@lists.postgresql.org; Tue, 26 Aug 2025 08:46:08 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-afe775db944so321495366b.1 for ; Tue, 26 Aug 2025 01:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1756197962; x=1756802762; darn=lists.postgresql.org; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to; bh=3vJbzABzpk71sGd9+uUMiuXDi1W6FVM1Na2p2nu4oH0=; b=elQpZgKawswZ2ItRgNm+NgIMAPfM20uWVKgKYbFt2ZgiNgTmQm5qDANHNM3oZXQE8Q cSscDklc59ULfxPR9F3fcUC7IpRuLAee4TEU5PSJYZ0meEu13CT22ZGCboPyoTRi/7Zz ifSdev+2NKUfKnBSDF23AEekJ8W5PjAMg2LkdASZ/1BO0buXKeixIWLxzbR9JDRs/lcv Tr/NB3ZQwLAbl5ZLp1Y8c5VNPxwMl8TorZyZFdQc1kcOG9nqmTZVLk8qRjwpNOzQox60 qOHI7e2JYn6qtb2nYHAkDMYAHZI3Sn2sXfrZJtN9Dq47NxPjIkM2tH5TIahMuJJmNgX9 ktZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756197962; x=1756802762; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3vJbzABzpk71sGd9+uUMiuXDi1W6FVM1Na2p2nu4oH0=; b=KF40QRedq2L7HQn1GruUIHSjg+Dy6X5tYzsqUp665qbt6mHhfhVv6t/Qz86vO4hJn4 Q54keyx6tk5OzNvN+nLp7onU0FlCOLrMJ6Snc/kttGh18YFX9h35X+mRCwZuujbotnAT 5CXuHokJ4q2s0ZdKQkXbiUIYOyNA1jAns8Zxc9918tehHVUsnuKU+MGILgxVMCQhdvHZ naYP1JcmQfbSnTJh9ht/JFS9VFjqi2SPL1zS0r8A15xk8UR1+DqRoYzpzOA4trmO3eLh eImnKORLBRN9WwXrF/rCpRSpgRFkZpAxvqeURX6yZLZt7I3hffMQ/OaILEb/vQf1ORGa 2XSg== X-Forwarded-Encrypted: i=1; AJvYcCUHbjbmwECn+w4n4lUUXwXnQ+/KZRCZQHEEW3Rv/e2ttPRKnmaMZApQ3wMQVGpEfeg+vaJeElb/0OoZbBZA@lists.postgresql.org X-Gm-Message-State: AOJu0YyTxPqoo13lCzG4/KnbzDJPENX1yEoT59XluvxlmvfN9UaUbJPc Hub3zGnhY7dVLIfTufX539uBVJU4s4ycVJlqtvNjxMblluklp8QpGFO+pnm5NLMjDso= X-Gm-Gg: ASbGncvZe2SqJGEiLD03mSg2QqFCe02XVGhNaCd5m5a+nEPZH+PJ7oDy8r1l+Jcxvj2 Huv1CPlhTiDymNY9kCBg/YHQ0h0tVq6eyrM3a03leMltdrmqFVm9z6i3kqqNQhFcrZJ+QrPdS+c iwFNWbhlw74m2mwCXObtE4Gv6a5jfPIpEWybslcljH/p9sXRzbti6LqQn0SHm2/59LbkyjJECko zgQwXlGKUjN3Inp/CwALzgAxKSFsbtpBDg94wbZGoB4+NvLPD2CILWB9QKffhbvJPS751y/rmeA 4R1PZhLE3nJON+7nInKxjH/ZtkzBo9Lwnm/+LphbElXanA31C07ZvBO7PrG2XXTOmv5AdwgcPBx zcP8ys7FBmAWerYE2L6jS9G+X2ONU3uQ3b9A43uB5MUh8zuk= X-Google-Smtp-Source: AGHT+IHdGfFyk7x8kBrt1kG7cVEHMdXIynzdc4OG5zfiufR1Mg5lZKA4/7b5iJA0JJKQciyxI8bwAg== X-Received: by 2002:a17:907:d22:b0:afe:93c3:d858 with SMTP id a640c23a62f3a-afeafecd8d8mr80153766b.26.1756197961497; Tue, 26 Aug 2025 01:46:01 -0700 (PDT) Received: from localhost (109-81-168-144.rct.o2.cz. [109.81.168.144]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-afe492da3adsm735093866b.69.2025.08.26.01.46.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Aug 2025 01:46:01 -0700 (PDT) From: Antonin Houska To: Mihail Nikalayeu cc: Alvaro Herrera , Fujii Masao , Robert Treat , Pg Hackers Subject: Re: Adding REPACK [concurrently] In-reply-to: References: <202508091333.qvgvo7ikuezm@alvherre.pgsql> <40729.1755799624@localhost> <9536.1756127358@localhost> <21931.1756136535@localhost> <24483.1756142534@localhost> Comments: In-reply-to Mihail Nikalayeu message dated "Mon, 25 Aug 2025 20:18:17 +0200." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4789.1756197960.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Tue, 26 Aug 2025 10:46:00 +0200 Message-ID: <4790.1756197960@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mihail Nikalayeu wrote: > Antonin Houska : > > I think the problem is that HeapTupleSatisfiesSelf() uses > > TransactionIdIsInProgress() instead of checking the snapshot: > = > Yes, some issues might be possible for SnapshotSelf. > Possible solution is to override TransactionIdIsCurrentTransactionId > to true (like you did with nParallelCurrentXids but just return true). > IIUC, in that case all checks are going to behave the same way as in v5 = version. I assume you mean v12-0005. Yes, that modifies TransactionIdIsCurrentTransactionId(), so that the the transaction being replayed recognizes if it (or its subtransaction) performed particular cha= nge itself. Although it could work, I think it'd be confusing to consider the transact= ions being replayed as "current" from the point of view of the backend that executes REPACK CONCURRENTLY. But the primary issue is that in v12-0005, TransactionIdIsCurrentTransactionId() gets the information on "current transactions" from snapshots - see the calls of SetRepackCurrentXids() bef= ore each scan. It's probably not what you want. -- = Antonin Houska Web: https://www.cybertec-postgresql.com