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 1vbSJj-005bLZ-22 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jan 2026 23:42:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vbSJf-0095I9-30 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jan 2026 23:42:52 +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 1vbSJf-0095I0-1q for pgsql-hackers@lists.postgresql.org; Thu, 01 Jan 2026 23:42:52 +0000 Received: from mail-oa1-x2f.google.com ([2001:4860:4864:20::2f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vbSJe-003iya-1Y for pgsql-hackers@lists.postgresql.org; Thu, 01 Jan 2026 23:42:50 +0000 Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-3e3dac349easo12719392fac.2 for ; Thu, 01 Jan 2026 15:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767310969; x=1767915769; 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=0zv1XpPIcadxQlZ4YU9pQXmsZ4mnuiIBydSlHbcAGYY=; b=AQ2dKne5T/q/Dk1IN4VcQ0tyhBqO14Xmw6UbpsGzMEggHHOZrxIy5s7x2dbXP9HMe8 o7v3czJivph+UkkArbeQ8dixYvIkxX8XxYB29fo7YFCJYn3qEmD25QYZZbas4kng+p2q 1g108mcKlZske99XWaBUW626lKBPQdf0C5EV+/sZmpRgt+8gXU+sUzi4ApGh9XA6qss4 pyUnyzDeHenN4y/UnC7FsOLu3JTZqWjdfs0dAbLpHFpEcLgWI1Sy2lVlpDufPvZFhR4I ymsV3fzY3wm9nOJjVAiTRGBWvSzxQn7W1Mhu5uzbJn4jbxedVqnpY8BkIHbOGH3dLYxU 29Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767310969; x=1767915769; 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=0zv1XpPIcadxQlZ4YU9pQXmsZ4mnuiIBydSlHbcAGYY=; b=Z4tK7bRgZcKJLShI8XR5aMJXlJSjOY4kOlkHdLrQ9odkjYw+zMQ9rnuWz/aFzXbku7 O3YEUx8c+Ur3jelEpn4O3lMJBXofBzufdaK7n1j0jTc7AQmqbDlleo6okV80c7iYdMOn Js+P0jBUdYj3izEZ6mZswRLpldc/5nkRgR1Bl9MzH3qhNA0xY8KpRUAEKOercA4nxaAB e51cApL9eDrtpokT0zh0r5CMXU428WWW4rKNyrjGlcYocIpwmasno1gx0IVOqyhzfer6 dYJZJah3x4HHTPc8IDrwWKRu3oDuMPWg7ZbpYv4KMkrZhRWOj6IxYSD3zYmNXU4+SNE2 7XOw== X-Forwarded-Encrypted: i=1; AJvYcCU1OcHS+mk74PyW/gAGEM1c4k0/EjQvXnAG3HS0IKWtjF8+PTeDdPcfY7yz7L0uTWdgOg6+jzgb3uwhliNN@lists.postgresql.org X-Gm-Message-State: AOJu0YyfYDE0uLJiQCy9NtUpfPVF1ZylyepZueq559PWBsSBa/lwKP4m tIdvNW/QljrmFtQ8Ud1ujprgM4UJfp8POzb18uAz4WMmkyjbgOlh2tX/Nd6zHgehxwm+N7K3IBV L640FoRFVCCaNVt6zeu9frgI+E4hZSp8= X-Gm-Gg: AY/fxX6EWl10SHwUibSn3kAjXibtICHF9eXF4gKdbpUXs/Bf5bD1JabIf2vgLpEQWgp +nAevQ8jhQdZT3VG56N8X4aAH1O07guh7zVqQ3BR/ehyNCmViIeoEsIEuh64KEybY04lQTDOXcJ Rw3f1QZz5U7U+liGzWmEOYcqK5pDAzJHoiBm5a8Wwu9+y9w49cAu2mVOBKvPI0b/sv4BT2KoLwE BeUMDkoPXOEe6slU5ZYPJLdVtw+1dUIqr2ONR/XnlmbEvqVWA02ce/T7+wWsAQ6K62pnsSTJGRp Cx7XVV50qjv9DuPjLIk04Qt3VVRXfBYOJuWZhtUoahMZdXuPBgM+9V23CB0QbGwGsTcHlA== X-Google-Smtp-Source: AGHT+IFUhDOtL73bjBfhUheoX88wOxdhh5f2Jm7CTZTzFfDrOr36q+l0WhG5O1eeUhvOa7EX6CohtUz0yWM1faQgIuk= X-Received: by 2002:a05:6820:f029:b0:659:9a49:8dfa with SMTP id 006d021491bc7-65d0eb709b2mr19449719eaf.60.1767310968953; Thu, 01 Jan 2026 15:42:48 -0800 (PST) MIME-Version: 1.0 References: <202601011659.ikh4ku4p3ovb@alvherre.pgsql> In-Reply-To: <202601011659.ikh4ku4p3ovb@alvherre.pgsql> From: Alexander Korotkov Date: Fri, 2 Jan 2026 01:42:34 +0200 X-Gm-Features: AQt7F2outnksFaYL7aizWZfeiPFymWxlOtBxxwCUWf_2M8c_5YzBsv6_mtGwDRs Message-ID: Subject: Re: Implement waiting for wal lsn replay: reloaded To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: Xuneng Zhou , Chao Li , pgsql-hackers , Andres Freund , 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 1, 2026 at 7:16=E2=80=AFPM =C3=81lvaro Herrera wrote: > In 0002 you have this kind of thing: > > > ereport(ERROR, > > errcode(ERRCODE_QUERY_CAN= CELED), > > - errmsg("timed out while w= aiting for target LSN %X/%08X to be replayed; current replay LSN %X/%08X", > > + errmsg("timed out while w= aiting for target LSN %X/%08X to be %s; current %s LSN %X/%08X", > > LSN_FORMAT_ARG= S(lsn), > > - LSN_FORMAT_ARG= S(GetXLogReplayRecPtr(NULL)))); > > + desc->verb, > > + desc->noun, > > + LSN_FORMAT_ARG= S(currentLSN))); > > + } > > > I'm afraid this technique doesn't work, for translatability reasons. > Your whole design of having a struct with ->verb and ->noun is not > workable (which is a pity, but you can't really fight this.) You need to > spell out the whole messages for each case, something like > > if (lsntype =3D=3D replay) > ereport(ERROR, > errcode(ERRCODE_QUERY_CANCELED), > errmsg("timed out while waiting for target LSN %X/%08X to be r= eplayed; current standby_replay LSN %X/%08X", > else if (lsntype =3D=3D flush) > ereport( ... ) > > and so on. This means four separate messages for translation for each > message your patch is adding, which is IMO the correct approach. +1 Thank you for catching this, Alvaro. Yes, I think we need to get rid of WaitLSNTypeDesc. It's nice idea, but we support too many languages to have something like this. ------ Regards, Alexander Korotkov Supabase