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 1vdwps-00728g-1i for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jan 2026 20:42:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vdwpq-004IOz-2x for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jan 2026 20:42:23 +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 1vdwpq-004IOr-1j for pgsql-hackers@lists.postgresql.org; Thu, 08 Jan 2026 20:42:23 +0000 Received: from mail-ot1-x334.google.com ([2607:f8b0: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 1vdwpl-005LbB-36 for pgsql-hackers@lists.postgresql.org; Thu, 08 Jan 2026 20:42:22 +0000 Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-7ce0ef9d4eeso1557236a34.1 for ; Thu, 08 Jan 2026 12:42:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767904936; x=1768509736; 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=wfRCLFmRVSmhCL0lJAQXal9uqu436pgCEzOyeT0s1Ho=; b=OnxyAqaJSizNBfJkqDRoX7Bes8notME4ajpqZ3o8FtZU0XYAHJLzKE3IbKpyJh8p3j j/7CYBghE+mP/BIkutLRy2V3cJvZE1GLDTy0YUrY9W2DrbY1X3abYGI7vL7uQBBZ0gPr SN0YfXAiVsCEgpFv6NrInoRK1NGhaCra+bM/3oO0ab4Xl7BSr1Kb32Gl48QlGfqHXfuL fEDThXqVCIp70xmV0V7ZurPd26BvZFNYURuSOc0hOvuWahezhuf9FZ16BSagE6jNsE1u mMV5gD5YmHkp2YDUPiErh/8WzZmgQZnax/+dnM7eqg6bPxvjyTW0oLV7o9Oa6kWe6XIL ISZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767904936; x=1768509736; 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=wfRCLFmRVSmhCL0lJAQXal9uqu436pgCEzOyeT0s1Ho=; b=qzaIbY6Ix0R/+yXYiWgAIXwJ8W32jIwZ8KagUYlwgP1cdvJqmk9fLmegq+Z0rsl9W8 8izEeTfS1CqP0uxc9sexh60pyyAhjHxmjRvwf3gYO993OK0lTraEevmjI/wvbjF2/NmU KuY9iTftOUJjIPiCWt4q/5lT2GLJY1FRfvIVZDCQLUsT4IY/9GK6Vpa+WCMxq7n4U2H2 RVgKy9q4Y08d/84G6e8ldFomniLPnO6jYArLOQdPwDgzuuxgCAPBibQ8zFdWDZ61wI42 0wu/vupku6nZPlmdqHLnimsWepFomsC52yo0xraYS9RCRkNvsqZSmHsV8+/PLhFHToh7 fwqA== X-Forwarded-Encrypted: i=1; AJvYcCXt0ElPHe21fTY5FkPoE1bZF+zfJhGQVHQ4VyIG67056OVeIuGSaAuw6fcNUj7lCH4JoyZc9rdy3vrwSSyk@lists.postgresql.org X-Gm-Message-State: AOJu0YyS7BQBwLx+EsNCq03mtPspxpvZYuQ/ezRgbqTKWbzeRKmAiaUI DQNsku+h8YFqcYvZOIzjWgMW7zt4V+/AgWgYba+fumTuCoFPD6lLS69tuZe9JfOvcYRpZ4bjBRV qxwVNl4KssxIH3Lfl3P4XK8UXB1UB+qo= X-Gm-Gg: AY/fxX48PsL5hYs15BsPm1pH1QvcmOJ/I6+eIs2MAdrP3bnj/BFby0zsdfFfKCz2EiI dcxxMvnqFbjg2cDEC3JIBz2OosmLAqLCswmLmuoAHKfJLoA672hKrb8dGx1tSSRC2HDSiR/IPbq EZmsugtoLyy39c2JS8Ezb85ykyEytJENMY8/XESPnqIanXRlJCbLwrolPhIb/VTlifR2lg66sxp MVOIf1XaQ0jlwj3Uz0ikrCslNNddM26sZQDK7IpaaAFLYLmjyZZE530ubNm6bsF1JZ7pwZX6Sml Q+uFe8M43APku932ZFn1D9CHFJvb5GDQFgFBvfN2PwBqTcwIS/AiHGjisMCDD83N6y+mSw== X-Google-Smtp-Source: AGHT+IE+cmzmihjFKJmvSE6FaOyrwRFo2P9va1fTUrU7yNhS7xq4SjK0ieNuo/1EfcHaHBz4W9PNKD0UjVMy4VfwO/w= X-Received: by 2002:a05:6820:678e:b0:65b:35a2:7a8b with SMTP id 006d021491bc7-65f550adb50mr2034488eaf.82.1767904935723; Thu, 08 Jan 2026 12:42:15 -0800 (PST) MIME-Version: 1.0 References: <202601011659.ikh4ku4p3ovb@alvherre.pgsql> In-Reply-To: From: Alexander Korotkov Date: Thu, 8 Jan 2026 22:42:03 +0200 X-Gm-Features: AQt7F2o7sDon8P4aij6mfXPyuJyEL8vkG8NU1fJw1v_gu9aEyUTyk2plpdz8cFE Message-ID: Subject: Re: Implement waiting for wal lsn replay: reloaded To: Xuneng Zhou Cc: Andres Freund , Thomas Munro , =?UTF-8?Q?=C3=81lvaro_Herrera?= , Chao Li , pgsql-hackers , Michael Paquier , jian he , Tomas Vondra , Yura Sokolov 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 On Thu, Jan 8, 2026 at 6:29=E2=80=AFPM Xuneng Zhou w= rote: > On Thu, Jan 8, 2026 at 10:19=E2=80=AFPM Alexander Korotkov wrote: > > I see, you were right. This is not related to the MyProc->xmin. > > ResolveRecoveryConflictWithTablespace() calls > > GetConflictingVirtualXIDs(InvalidTransactionId, InvalidOid). That > > would kill WAIT FOR LSN query independently on its xmin. > > I think the concern is valid --- conflicts like > PROCSIG_RECOVERY_CONFLICT_SNAPSHOT could occur and terminate the > backend if the timing is unlucky. It's more difficult to reproduce > though. A check for the log containing "conflict with recovery" would > likely catch these conflicts as well. Yes, I found multiple reasons why xmin gets temporarily set during processing of WAIT FOR LSN query. I'll soon post a draft patch to fix that. > > I guess your > > patch is the only way to go. It's clumsy to wrap WAIT FOR LSN call > > with retry loop, but it would still consume less resources than > > polling. > > > > Assuming recovery conflicts are relatively rare in tap tests, except > for the explicitly designed tests like 031_recovery_conflict and the > narrow timing window that the standby has not caught up while the wait > for gets invoked, a simple fallback seems appropriate to me. Yes, I see. Seems acceptable given this seems the only feasible way to go. ------ Regards, Alexander Korotkov Supabase