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 1vQEav-002Tbl-0V for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Dec 2025 00:50:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQEau-004xHC-0T for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Dec 2025 00:50:16 +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 1vQEat-004xH3-2j for pgsql-hackers@lists.postgresql.org; Tue, 02 Dec 2025 00:50:16 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vQEar-002f2u-1B for pgsql-hackers@lists.postgresql.org; Tue, 02 Dec 2025 00:50:15 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-37b97e59520so31610671fa.2 for ; Mon, 01 Dec 2025 16:50:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764636612; x=1765241412; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VOdZI21R75PYp0vLpbuBFQ9hCu1sBu/fuHWJ+faAqEY=; b=bB1WVlzA1Qf2TkHX2KrbGEq7flzjtbX4KUn61hIX3KLirdpMyPdn/geq/z0Ei5wTJq GmRuIndbmrtijiZ2aDP+YURb2D7N3TubsBb8FzaxeXM+rWo/bmIBfDYwZhKGsR6z00Ml 9nklS8N/fSbdhXigwVQRwQZQVTxm5VHpZGMH6PMMBKPdIdzZQCo8+XMlPWYYkOJSB5tY arDMKb8Tn938/8+TWYK+JupA6gfwMHR4fpepGB4nf38qvK+tR9a2ZTGC8FZRuMJSC8Z4 VgDgxYDi7Iz8s4a9Jq8/L8OGfv2M25s/VZ4/WJLEY44SySz9AoE1gIAlRtc2QZEkvgCM bYdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764636612; x=1765241412; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VOdZI21R75PYp0vLpbuBFQ9hCu1sBu/fuHWJ+faAqEY=; b=EYuA2NiavkBdCFlW0kpoD8kqG1DWUmrfb9DruoW1ocSirQ3gROhqtewubLMCQ2y6df 03HNRh9H49LCfwlLxpKRqBbVTMA1gACt34dfpapGbOfVTK+fPYmLmD+m+XKFqrMcO1Tl tUVsIrd0srTqUEDcJD5TZb2EZTH985eiitMNCy0g924qftYGqJFkyj1Aee0k1q+f9KU3 q+4rDrOE1HL+zD7H/blSOrtyxFGm09WbJLR3TfqWnzVF9K3r37bZKeyffQvX4Ex9Y4ha N0yEVboS0uAwV0U7DaIok9SzfbExiAF1KrnRib9SFesi5wnuskMtv1Sy1H41ecbw3OWM H7Tw== X-Forwarded-Encrypted: i=1; AJvYcCU2xHCt446b9M+XAMTj/NjlLARp8J0QEhhuC2KKSmIAUIaE9rCyAJmXLPW+XK5jMyxeI5CJL0JsVVW+8okk@lists.postgresql.org X-Gm-Message-State: AOJu0YyCrYf1PDr2XpyxNPxygzODhE0ZgUEIIqpbkDrTLIpSzpig7iC8 zsA3gV2CO854unXI12mZM51KbM2RWFgm+3uA4E6JmSKsu44rG0f9WSI5TAlrqraWiUhB2Q/obuK 8oD086QS/8CW28/1JGh31vsH0eJDjHrc= X-Gm-Gg: ASbGnctTcDBsyO0rsfrb0c7pRQLHv57sHm14X49lZzR5i3PR9f2Kzs0FOqxSnzdbUBo vSxaLwr6oSx4Xf9kydkdYOZZwdmgV2T8OFuDWmurSa/3KZnotr132C/plnQFSmOQI3yIJulQNKm gRSHCEiXNoWOzJxIICoTDa9OG8zl5VbSM4igFiL8yT0tuvLxdz8nsRLotFhPT4PxY46FG4I8hUS JAx5jQBjleK0rSwmJ9H91chpPHMptdZyyZXavvGJZ/tlBLOUqKkPg99ZYPy9UF1+3WpmLQ25paw BHC+h6wR1TTIiR9ocmKVOi/KhqpZTSB+tADaWVAx X-Google-Smtp-Source: AGHT+IF1rEbQdv1VjapNKmiris4ViDNa9cL3Cnj8g1b+p9qTf6XfaOwGUH3wv7Wuf+Pdbwsd+w/AzC1hZTLADhPfwvM= X-Received: by 2002:a05:651c:3043:b0:37b:aa93:613d with SMTP id 38308e7fff4ca-37cd919f5c1mr92078881fa.12.1764636611860; Mon, 01 Dec 2025 16:50:11 -0800 (PST) MIME-Version: 1.0 References: <202507262156.sb455angijk6@alvherre.pgsql> <202510301734.pj4uds3mqxx4@alvherre.pgsql> <11472.1762156600@localhost> In-Reply-To: <11472.1762156600@localhost> From: Mihail Nikalayeu Date: Tue, 2 Dec 2025 01:50:00 +0100 X-Gm-Features: AWmQ_bmkaGzt8DAh0cGvMs8H6MKZM13hEt8at_h4AH3_jEWNvXMeJeCFPR3hCZw Message-ID: Subject: Re: Adding REPACK [concurrently] To: Antonin Houska Cc: Alvaro Herrera , Pg Hackers , Robert Treat Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, Antonin! On Mon, Nov 3, 2025 at 8:56=E2=80=AFAM Antonin Houska wrot= e: > I'll fix all the problems in the next version. Thanks! A few more moments I mentioned: > switch ((vis =3D HeapTupleSatisfiesVacuum(tuple, OldestXmin, buf))) vis is unused, also to double braces. > LockBuffer(buf, BUFFER_LOCK_UNLOCK); > continue; > } > /* > * In the concurrent case, we have a copy of the tuple, so we > * don't worry whether the source tuple will be deleted / updated > * after we release the lock. > */ > LockBuffer(buf, BUFFER_LOCK_UNLOCK); >} I think locking and comments are a little bit confusing here. I think we may use single LockBuffer(buf, BUFFER_LOCK_UNLOCK); before `if (isdead)` as it was before. Also, I am not sure "we have a copy" is the correct point here, I think motivation is mostly the same as in heapam_index_build_range_scan. Also, I think it is a good idea to add tests for index-based and sort-based repack. Also, for sort-based I think we need to also call repack_decode_concurrent_changes during insertion phase > is_system_catalog && !concurrent 2 places, always true, feels strange. Best regards, Mikhail.