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 1virzs-00080G-0N for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jan 2026 10:33:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1virzr-00CWKt-10 for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jan 2026 10:33:03 +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.96) (envelope-from ) id 1virzq-00CWKk-39 for pgsql-hackers@lists.postgresql.org; Thu, 22 Jan 2026 10:33:03 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1virzo-001sxn-2V for pgsql-hackers@lists.postgresql.org; Thu, 22 Jan 2026 10:33:02 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4801d7c72a5so6076775e9.0 for ; Thu, 22 Jan 2026 02:33:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1769077979; x=1769682779; darn=lists.postgresql.org; h=message-id:date:content-transfer-encoding:mime-version:comments :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6rCbPu++mr2stjL61spykTwDpB814k0sXJb8TAbyQXU=; b=I0RI3DbT3CqvMpEvMwac+Q1jr7zTymc2lKRd4hY7MGpEzcO3FBv3GKjlMVECA0TBw8 1uDZhemAy8OMhWg42I2RSoUmtWE0/DPUlHEFRrRBcz04LFnVnOH5hQGJqWikEgIarYqn /H8cf3zYuqhVhjRurJGPs+yVbFzXZhBLbbC33yo/LN15yFRq+wo9HuxzoCAKvBemYXrN XkYZbj/l6I5btQGU+DDPp1tXl2XVI7lmmMce0BFBVtaBqeIB/BFHbMdwpVGPOCU54T8L wOzozOfv1K0lmI7lg83ZDb/1lvwTh0qim7oTWbjD82iAQDCgric1YTtIgC9/7hITxUGU 8PCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769077979; x=1769682779; h=message-id:date:content-transfer-encoding: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=6rCbPu++mr2stjL61spykTwDpB814k0sXJb8TAbyQXU=; b=CxX4+5ZBxiD4uoa1bSJVGx2rG4YjZofoYhw3agrSCzgfnQsjwBsqUh54tvSgNrSKmZ MShASJ78F7EbeD4PKhQmGEdJFHPPp1ZwLxJTKrN2NNhZMWocWqS3uXcFirPdGZzHAZ3O lv5lpga6zcmbD6ihBWgVBBESAAj3ooV3CKkNuJ67R+c0csWWSjabNRiezF4H9cRu6F56 VlwUswgO6/x7vgoEFnSKZGpcwsJYwQkF/XgI3Y8m8T0zAAeBxY9N0CjSwIyQ8BJUSHO7 RcOOpps0gLta6UX9de0CQkZZJGXV1cK9NaCmAQYLDaRk6GszKvtFD6WbMcRrm0LrscaU chPA== X-Forwarded-Encrypted: i=1; AJvYcCUgAlzWm9lDGBOgZ2pmqxxD3h424Pk/W3OoaupnvrsvUAcSeUDL51wuql8u5GL9pCjhgO1eP7hSaXYVQ5mR@lists.postgresql.org X-Gm-Message-State: AOJu0Yy5KbeMGLrQa7/zE2vFdBwoKb8XVy/RLz0vWZR7wiASbFe3CfKV rh/PKkmxe9BF1g+Z1CMu4lxJsS90v2fYF+8x+Qpht4UxWOELibHhRBxT7HeMw6Y1yug= X-Gm-Gg: AZuq6aJOHavbv2A5299Re0LmMrqODFrzEdrrYlKtVkQXkAxoeDYpmMqt87x/o2LSz8B Bz0Hn9zPBtA6czUQi2fyfHoRb3atP+KsdUkHw1wGBdPtHjL68KTlFwEkLy+Ha3igYayUaXOG1sT ozXIp2vAds7yWTWC/wrXNliR/gTyx7MnhWh/bt+3yX3P26AAVEGxrXa/llfMvQa4ihKkeH/k+4X a8IHBtVcFBXqrJdBox8iKsbMBVCESNB2Y+damsDFmrt3DW+MGhQBu+N+GGlayMupv9KGMM+ub87 OOeUbJFK438hdZvo9tho0fBYssHabX7rcplzr6F4xFv30u7U2zFYkbOf0/zoTCwV8CMLmNn3cHX mol9QwI3y9D1Rc9/pZaB2H4U9yOoVcr7f+7jleNUHw0Mv39/0kdOTGy/agmK26GkOObdxUPerAd uqWk2IQxsWTzzt2W6MoNP8wHqMvvDlyycVpDA= X-Received: by 2002:a05:600c:4f4e:b0:47e:dc64:f1c6 with SMTP id 5b1f17b1804b1-4801eab51c8mr326317255e9.6.1769077979498; Thu, 22 Jan 2026 02:32:59 -0800 (PST) Received: from localhost (109-81-168-246.rct.o2.cz. [109.81.168.246]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48042c3a734sm47735625e9.14.2026.01.22.02.32.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jan 2026 02:32:59 -0800 (PST) From: Antonin Houska To: Mihail Nikalayeu cc: Andres Freund , pgsql-hackers@lists.postgresql.org Subject: Re: Race conditions in logical decoding In-reply-to: References: <85833.1768840165@localhost> <62335.1768897833@localhost> <5k2dfckyp6zv2fiovosvtbya5onvplgviz5n4kdamxupff4vi2@yytzfnwr2ox7> Comments: In-reply-to Mihail Nikalayeu message dated "Thu, 22 Jan 2026 01:24:43 +0100." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 22 Jan 2026 11:32:58 +0100 Message-ID: <124728.1769077978@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mihail Nikalayeu wrote: > Hello, Andres. >=20 > On Tue, Jan 20, 2026 at 6:50=E2=80=AFPM Andres Freund wrote: > > I don't think that's enough - during non-timetravel visibility semantic= s, you > > can only look at the clog if the transaction isn't marked as in-progres= s in > > the procarray. ISTM that we need to do that here too? >=20 > Do you mean replace > > if (unlikely(!TransactionIdDidCommit(builder->committed.xip[i]))) > to > > if (unlikely(TransactionIdIsInProgress(builder->committed.xip[i]) || !T= ransactionIdDidCommit(builder->committed.xip[i]))) This way the synchronous replication gets stuck, as it did when I tried to = use XactLockTableWait(): subscriber cannot confirm replication of certain LSN because publisher is not able to even finalize the commit (due to the waiti= ng for the subscriber's confirmation), and therefore publisher it's not able to decode the data and send it to the subscriber. --=20 Antonin Houska Web: https://www.cybertec-postgresql.com