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 1urBRp-001vA6-F2 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Aug 2025 08:24:02 +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 1urBRo-00DR8A-IG for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Aug 2025 08:24:01 +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 1urBRo-00DR79-8A for pgsql-hackers@lists.postgresql.org; Wed, 27 Aug 2025 08:24:00 +0000 Received: from mail-vk1-xa30.google.com ([2607:f8b0:4864:20::a30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1urBRm-0026ln-1R for pgsql-hackers@lists.postgresql.org; Wed, 27 Aug 2025 08:24:00 +0000 Received: by mail-vk1-xa30.google.com with SMTP id 71dfb90a1353d-53b174de200so4535965e0c.2 for ; Wed, 27 Aug 2025 01:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756283036; x=1756887836; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2+rt3EyC172zU3kCFKZU+0ImgTlT1LmaGF/tQnBlGJM=; b=YRyDe10vZBXgNMvMPxQK87+OdsFNpvV9x5eE/AGEhA7LdCW11sXRexEseAqIeBs8Vb BO0rIMdJw6HQj3YFfZ/yLbcBZRvKQ4Ta1U7npA07yg4lccBpwMzk7C+4S2XAaIT9NpTE 6qWwtVR5GrpFTg7zK2bsZIds++ZHLbxtk+mhrk1I9yq9QN1nd11yYcUS2fJPpf/cId+X WunocoF4T9qS6+6IrkK1+7OmCXkD0MwzYLQMSrzzDLpBaKJPgbdQCLvrJ6RFbTSUKGlC xJRc1XZOIBiqBYozfCFD7+h3aFXppMglYzQEoFrIvWsT2POfnGhQOVQr2iexZqC639Y5 m9fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756283036; x=1756887836; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2+rt3EyC172zU3kCFKZU+0ImgTlT1LmaGF/tQnBlGJM=; b=OoLIqGZs1Ly68TX2UGKrlc9VN4//UvVAZjjkoyy4wHyNC4F/Mlm4oNm8wIpYloLK0+ XSRlIRFhmLR3W4WkQYZn3S45oV5u1BWrPG+Y9DZkJ6zL9FX8KYhrerMAVdmes9nl6qtu b0QpvGujV3RHpDyG18qPEJ6c7VIlUv2pRtkGbqts9OHJZPW5lzqANbKk8M36JIEG1p+X IbdiUA/YswXc81XIH5ZcpBUiAIM28eLGK+KNkzyr4qSfwXqFFe6D5Wb4wA115keAoyS+ xAPPpPkYE9mrZBkWCuLBoli6xryLahwwrfnFac4ex9WFMsIs3r/l4GR7jf5pHOS8+Xj5 3dgg== X-Forwarded-Encrypted: i=1; AJvYcCW8EsVPo0zSQz/qHZBFamatW5VjT2NYUnAclpn8+x5Mh/NYE2PPf0CFrumUbKSTh7OxaqiLCLAGE5J9VbYy@lists.postgresql.org X-Gm-Message-State: AOJu0YzAw0gIcFhG3IyaFDzOis/dRC8QMJAm2oEyqsOrJQ9T669sWEIY 1UTf/MSqgPOxa9iZQ3hOi6QpSAAZzGHCpKYjcehhdl6BcvDIsXw22ZMgZgxYBVUb3wYVSUIwSaQ EsMwGrPYs55y5LwQGa3xorDef/LST0OM= X-Gm-Gg: ASbGncvKqsLfBJmOZKCs3P1k/cDG2S+r1fhzE+Pj0lAsRqzgNOt9Elb1gDJX8Xj9OSx kIA0DEgOE6l8nj1AV1ZLQOyjrwzXIybWwZG+uuKnsmf29Z9QcpphwFaC66hSq0h2agV4i5IdpfB K03ORvIcGzZhYlWBeoBf6a5EMOQg3mmjjpELIpLeYgugxH6ZInmtAa2PJvf16KhlCMVgINZ3KbR RV2fbo= X-Google-Smtp-Source: AGHT+IHKYsY7zhKON44pM7nLrWllVw1+2+HsLuV8DIeJk1krgGjtqHDCCtYciPTei1Hcr+q3XCsDVkoTLt4INfMYIIE= X-Received: by 2002:a05:6122:896:b0:53c:6d68:1cd7 with SMTP id 71dfb90a1353d-53c8a3f18f2mr6292113e0c.13.1756283036541; Wed, 27 Aug 2025 01:23:56 -0700 (PDT) MIME-Version: 1.0 References: <202508091333.qvgvo7ikuezm@alvherre.pgsql> <40729.1755799624@localhost> <9536.1756127358@localhost> <21931.1756136535@localhost> <24483.1756142534@localhost> <4790.1756197960@localhost> <29527.1756215093@localhost> <6931.1756275367@localhost> In-Reply-To: <6931.1756275367@localhost> From: Mihail Nikalayeu Date: Wed, 27 Aug 2025 10:22:24 +0200 X-Gm-Features: Ac12FXx9cfQ4md9hZfCjDpHoqeJYNOWO3LTMwhYjTRcXGNqKeb357sC8_3ecVVs Message-ID: Subject: Re: Adding REPACK [concurrently] To: Antonin Houska Cc: Alvaro Herrera , Fujii Masao , Robert Treat , Pg Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Antonin Houska : > I insist that this is a misuse of TransactionIdIsInProgress(). When dealing > with logical decoding, only WAL should tell whether particular transaction is > still running. AFAICS this is how reorderbuffer.c works. Hm... Maybe, but at the same time we already have SnapshotDirty used in that way and it even deals with the same race.... But I agree - a special kind of snapshot is a more accurate solution. > A new kind of snapshot seems like (much) cleaner solution at the moment. Do you mean some kind of snapshot which only uses TransactionIdDidCommit/Abort ignoring TransactionIdIsCurrentTransactionId/TransactionIdIsInProgress? Actually it behaves like SnapshotBelieveEverythingCommitted in that particular case, but TransactionIdDidCommit/Abort may be used as some kind of assert/error source to be sure everything is going as designed. And, yes, for the new snapshot we need to have HeapTupleSatisfiesUpdate to be modified. Also, to deal with that particular race we may just use XactLockTableWait(xid, NULL, NULL, XLTW_None) before starting transaction replay. > No rush. First, the MVCC safety is not likely to be included in v19 [1]. That worries me - it is not the behaviour someone expects from a database by default. At least the warning should be much more visible and obvious. I think most of user will expect the same guarantees as [CREATE|RE] INDEX CONCURRENTLY provides.