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.96) (envelope-from ) id 1vluFn-005ARu-26 for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2026 19:34:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vluFl-005yrW-2I for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2026 19:34:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vluFl-005yrO-1G for pgsql-hackers@lists.postgresql.org; Fri, 30 Jan 2026 19:34:02 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vluFj-000DCS-2X for pgsql-hackers@lists.postgresql.org; Fri, 30 Jan 2026 19:34:01 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-481188b7760so17400115e9.0 for ; Fri, 30 Jan 2026 11:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1769801637; x=1770406437; 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=d8MEhUyOi2IuQA7ZWE5rPz9GNsx4Bh9E83CyHwHHrg4=; b=iKcI2Dkrn8NEfZpgQx5Z9edJMzrfeP9dYYTbxlO917MACPZpYfbSnBeI06N8BdEBet NWRN/yks1PEGeZY8EGmWk0EfzGMH84X/4I+1bcd3K/+jbO4Av+9NqiJa7SOHyDJCfU1D X1FVnyfrqJRVzqkk0a6DKgjNUyTaV3GYnlqn8nJyFZVFRx3PyczbvlEiHXrFEY2B7r2O LQb/FjsBm7+GLrKLvNUghxq64l76ttR+kUG4qFwN/JZ9zpUTi6PLKOb3lz1SpwytFEk/ Y88aq9uqbncIF3S24Gjp21bUATF6CsCEPFuIc2s1wJ0pjJFeIks7J2hrq1Q2AxnpwSWu C85w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769801637; x=1770406437; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d8MEhUyOi2IuQA7ZWE5rPz9GNsx4Bh9E83CyHwHHrg4=; b=Ngg3gHuSvs53aPR2K/PQd/EttaFheGF373m50G4zknUrzCN8Uo8iMAZlSBu6pZTNUH hBHnsv0Ci7eL8chNkFZwUqIZKUjvbpb7P7ro+OJeJxnJKEyrThFq/+OU4tT8ojpTdMnq 3vJmyE0FzXHur6mPnAYeMQ5Z0WAdjYLDPG/jGp7gVXFRHwUyFTepowlfh25czgE+vDnD Fm5XBaCATSVLt4PtwmHB6O7v0kZv679TPB7XHyxnfoIBdFsiE/TjB1Zb+RP43vN7UrHA KlVu28okvOooM5us8a9DhMftCzpj4cVoTYXa6BSBlcXLowIalav/48PxgDH8/8PUdXN6 ssDg== X-Forwarded-Encrypted: i=1; AJvYcCWYq20c9axcUCOjK+A04vPX/BBadiIrugmf0a0W9VmdHefu7qf7zXcXDQY/T/rxh7zxNYzTIUOPBnIJ1Spp@lists.postgresql.org X-Gm-Message-State: AOJu0YxXxJ4WPjHxFhwSHf2gyDWT45dQJPU3oEJ8R+OYK/j5Mc2W//La zwb3ZKtzSix+SAgXDotszqmZkimZ8BWUII9MxAN/OvbacnhXYd4rPHghVxvU4f//pRk= X-Gm-Gg: AZuq6aKCy6DhbSobIhLkTA6SVaIkJmwSw6V/Mj/fsyMhQKmNZwssxqKi7+GzfewBUkn bT63BQbbMnkyJwFdDbRoFLo3K1iOjssnQ6N0hZQumqPUAwNm/1WsuqooBPXnI6kdcOkYDosEYCj of32wF3CjzN7K++kA3nupqGHDT5JP4uJmRd5os0jpKSNXWGSjVby1S+MmitxxdKZwCCjzF3DDOz SnKedyl4TGtPV3mgDZPEAk1I0kQ4YtmuOYDIBZLSEQjkM9rC1cum74IzG5Vny6lHovBhOyJhMHi KelZeYtqX5CqF1bsAJRH8kqYCnES9mFmJ3nnqe8bT3s61AZalPTf+ugw3GOKsOsccoZCAdUv2G7 HkvAOnxsSdQ327YRVU6bw2CKDl9u34VqJe+rkO/ZIkC0OGaIvsOspRI8l3ffV5BceBZxN10/ow2 B2F6t5p4V9rW096jPyAW0CG7CW X-Received: by 2002:a05:600c:354c:b0:480:73ef:e73b with SMTP id 5b1f17b1804b1-482db4953b3mr45885095e9.25.1769801637384; Fri, 30 Jan 2026 11:33:57 -0800 (PST) Received: from localhost (109-81-168-246.rct.o2.cz. [109.81.168.246]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4806cdebf86sm203880955e9.8.2026.01.30.11.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jan 2026 11:33:57 -0800 (PST) From: Antonin Houska To: Mihail Nikalayeu cc: Alvaro Herrera , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] In-reply-to: References: <202512151349.vlq3mpfniyk3@alvherre.pgsql> <11247.1767609087@localhost> <11558.1767609632@localhost> <141054.1767891540@localhost> <137668.1768235610@localhost> <74802.1769071060@localhost> <3901.1769412880@localhost> <88003.1769511456@localhost> Comments: In-reply-to Mihail Nikalayeu message dated "Wed, 28 Jan 2026 03:06:00 +0100." 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: <57209.1769801636.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Fri, 30 Jan 2026 20:33:56 +0100 Message-ID: <57210.1769801636@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mihail Nikalayeu wrote: > > PROC_IN_VACUUM shouldn't be used for the same reason StartupDecodingCo= ntext() > > avoids setting PROC_IN_LOGICAL_DECODING in transaction. I've removed = that and > > the tests work for me. Especially the "cache lookup failed" error is = almost > > certainly related. Please let me know if you still get the other erro= rs > = > Yes, now it is passing. > = > > (Except for 2, which is probably due to the MVCC-unsafe behavior, as = discussed > > earlier.) > = > Not happening too. BTW, it was non MVCC-related, because in that case re= lcheckxmin would catch it. > = > What if: > = > 1) add new PROC_IN_REPACK flag > 2) use it in catalog horizon, but not in data (like was done in [0] for = PROC_IN_SAFE_IC) > = > And after we have options: > 3) do not "table_close(NewHeap, NoLock);" - keep ShareUpdateExclusiv= eLock all the time to prevent VACUUM enter > 4) do not heap_page_prune_opt in repack transaction (just using simp= le flag) > Or > 3) preserve xmin/xmax of original transaction in repacked data > 4) but better to keep ShareUpdateExclusiveLock anyway I've been thinking of another approach. Note that REPACK creates a new tab= le only to eventually swap the relation files and drop it. Thus the transacti= ons needs to get XID assigned very soon. I'm considering a special kind of relation whose catalog entries remain in= the catalog cache and are never written to the catalog tables. (Unlike tempora= ry relation, it'd be WAL logged so that REPACK can be replayed on standby.) If we eventually implement the MVCC safety, XID will neither be needed dur= ing data copying. And it shouldn't even be needed to build indexes, as long as their catalog entries are also "cache only". Thus the transaction REPACK i= s running in would not need XID until the data has been copied, indexes buil= t and even (most of) the concurrent data changes replayed. Only the final catalog changes would require XID, but those should take very short time. Without XID and with the snapshot resetting, REPACK should not really bloc= k the progress of the VACUUM xmin horizon. -- = Antonin Houska Web: https://www.cybertec-postgresql.com