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 1vmqLH-00GvPT-29 for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Feb 2026 09:35:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vmqLF-00DEQZ-2G for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Feb 2026 09:35:34 +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 1vmqLF-00DEQO-1B for pgsql-hackers@lists.postgresql.org; Mon, 02 Feb 2026 09:35:34 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vmqLD-00000000Ahs-3zin for pgsql-hackers@lists.postgresql.org; Mon, 02 Feb 2026 09:35:33 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-42fbc305882so2607080f8f.0 for ; Mon, 02 Feb 2026 01:35:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1770024930; x=1770629730; 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=EwLNaTYEWmtMkwdQtG/3Iitnps6Y5toH8U3OBz3jNUk=; b=gk8Ow0IdPC2eGabAUHiuozbPke62K8Hcex03Hg0sPnxP/sWlsbdOayGuTMczwrm42a V1HibMiTShZm3fLCFNjTie2bja8vhdFQTHWjkFPGFSnOOrj7Kos4Ha88gq0uoVDOSquQ U1MK6g0wUREgSor3CYgjA5WksoEvJWQuo05sG57ZsRt5O+Vy//vOSkGo7wNqyY91+Koy XC8+PYPBIiE+eTLTV9dDSuMZHiR5Ix9e6gQGO0GYyv4s/4CMiecJSNuBqf81KrLFx5HM 7zaG2DOWF2O/22IObdFGcwbpxlQbBLVpf92alPPQPEeanPQNkElpsufg9LCTLVVfHy7A N5dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770024930; x=1770629730; 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=EwLNaTYEWmtMkwdQtG/3Iitnps6Y5toH8U3OBz3jNUk=; b=X+ocb2bnyQYYhj05DlxqZel2dggyADId/+bIEWnG5khaiU6PRYTKRlosaEYvLsnMRD 77CKIJP+eXfJPZEdwdAa8zWFXZrYRKb1p7podsYIh65LSpyCeC2fsf4Zx7XhAFTOk9Vr NatbzHnkmtZ3JD1U8iIcILHnHyGshuUCloFUUubHRuro1Phgl9Do4Ga03H3eEosaZhUC 88JujBoXlWkqdobcaW88CHnCRK93pmlu6JDQDxlCE+E7EorC/Mu/qezV6oEfzXTmHA58 v9cul7jld4Wsj6yQfIl6kwys1leUBG42ElCDVaUh8q9w7vubi1zFEFktbjQwDD/EzwNf deaw== X-Forwarded-Encrypted: i=1; AJvYcCVlnMO4wjc+NBOLgn83KkIo1ta8xUzXWblmMxmWYF/uNG/NLZHufoKClEsRHRW9qwdGFmNUcJ80HJ4XArrI@lists.postgresql.org X-Gm-Message-State: AOJu0Yw+0lF6+Pr/o+CnYLauL9JUEBOvg7W3o1D179Y8NkZrTyrMmtOV C3nu5o3Azpo0gHd+i2W18JCWab4gbM8F5dGJKHPCGHykxQSyYZprFR1HeAIBHEK6qpg= X-Gm-Gg: AZuq6aLsD1ceFeMO0LGBB9+gXFx42hMkGiEqrPub0YruGZ2NSrVrpolCaVxC5IE1QD1 teo0ZMo0zFLxKKBcPD4M0Wo4FbJjexuolvyhd9OVLztNDSu6Yy8ILmZ9DuX1qIJpwftg+t/0KVm s5NIfGHgbPCua66BHlgmJ1tpazXjo5l+/S5lhKjCiWGix1e3Wu3NR8qPZOhvKK98FqL6mbKOY8g hLSs/xLMjg4WJO1L5qkMz8VirTCyUAeqfgeyx4AzAS67xwfwpFYWsv5PS9xPSfiQHI6bXX/bsIr CZOx0kLPMidnRco3wuccolGdUMAoY8ETP0taaM+cUGpLOhTxpMPuW/kvBeDGlS2gBxeP05eXM8P at+4Er61U3GyGAzmT4chtuMSOb4zPrrgl6YYrCIDBKHuC9BhLpV3mNemqJxaoFOlWp1RSBbiv6Q Re0iArb0eJHFCI/MZkP5j2cxMtA7WtK8hvmQI= X-Received: by 2002:adf:e506:0:b0:436:7d3:b953 with SMTP id ffacd0b85a97d-43607d3b98amr3628135f8f.5.1770024930155; Mon, 02 Feb 2026 01:35:30 -0800 (PST) Received: from localhost (109-81-168-246.rct.o2.cz. [109.81.168.246]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10f82aesm45490516f8f.19.2026.02.02.01.35.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Feb 2026 01:35:29 -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> <57210.1769801636@localhost> Comments: In-reply-to Mihail Nikalayeu message dated "Sun, 01 Feb 2026 20:46:31 +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: <8028.1770024929.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Mon, 02 Feb 2026 10:35:29 +0100 Message-ID: <8029.1770024929@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mihail Nikalayeu wrote: > PART 1: > = > -------------- > = > Something still wrong with 0006, check: > = > 'pgbench: error: client 12 script 0 aborted in command 2 query 0: ERROR:= attempted to overwrite invisible tuple > https://cirrus-ci.com/task/6385612527239168?logs=3Dtest_world#L300 > = > But it is hard to reproduce - happened once. > = > -------------- > = > Also, once I got > [16:25:18.641] # at /tmp/cirrus-ci-build/contrib/amcheck/t/007_repack_= concurrently.pl line 57. > [16:25:18.641] # 'pgbench: error: client 6 script 0 ab= orted in command 2 query 0: ERROR: relation 21856 deleted while still in = use > https://cirrus-ci.com/task/4686014242881536?logs=3Dtest_world#L384 > = > It was the PROC_IN_REPACK version (see below), but I think it is not rel= ated to it. But I'm not 100% sure. I think it *is* related. My earlier patch version, which used the PROC_IN_VACUUM flag improperly [1] was also causing visibility issues. Pl= ease let me know if you manage to reproduce the issue with v32. > PART 2: > = > > I'm considering a special kind of relation whose catalog entries remai= n in the > > catalog cache and are never written to the catalog tables. (Unlike te= mporary > > relation, it'd be WAL logged so that REPACK can be replayed on standb= y.) > = > I think it is too complicated, especially including replication logic. I'm confused by hearing a complaint about complexity of code that I haven'= t posted yet. And I don't understand the relationship to "replication logic"= : REPACK (CONCURRENTLY) tries to avoid decoding of data changes in the *new* (transient) relation anyway. > Essentially we have two issues: > 1) make sure catalog entities are not dropped because the vacuum > 2) make sure data in new table is not vacuumed also 3) XID assigned early due to creation of catalog entries for the new table= - that XID prevents the VACUUM xmin horizon from advancing till the end of t= he transaction, i.e. till the end of REPACK execution. > Also, I am still not sure if MVCC-safe implementation is worth its compl= exity compared with "relcheckxmin"approach [0]. IMO it's better for users to see the correct data than ERROR. But it still needs work. [1] https://www.postgresql.org/message-id/88003.1769511456%40localhost -- = Antonin Houska Web: https://www.cybertec-postgresql.com