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 1teodh-00FoZ7-MD for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2025 05:04:54 +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 1teodf-00AGCc-Rf for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2025 05:04:51 +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 1teodf-00AGCU-Fe for pgsql-hackers@lists.postgresql.org; Mon, 03 Feb 2025 05:04:51 +0000 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1teodc-002ydF-2V for pgsql-hackers@lists.postgresql.org; Mon, 03 Feb 2025 05:04:51 +0000 Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-5f4ce54feb8so2168957eaf.3 for ; Sun, 02 Feb 2025 21:04:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738559087; x=1739163887; 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=U0XFF68Xx7UsAf+ZoefRqNsk6j3jDoIMEeyAzHbO6rg=; b=Iix0I7/NqMU8NrZ9/6F/kI/PlQqgV2t4Tpy86qjDY57X/NQzPvV/p4teXGwUypygI5 JyxLlmy8jNfcMxgo9gFIE0TIX/LZ4UGAguxzAVA27K4IhwTmUzoPh/7CLsh5H8LN/GwG kRM7e8QMEOMpod4sfSIhnjhd9049KZ8pPnP6h3Jf2cuR2VgL44hgDj6wg8yHuaBI7tyR EDtXlNrUcycKr2NEAlKOpWQW3ISW7zC6KlACKh9ncgWEeBWv1U7LU+BtGasqIoCoFqmS eJ2gPz+MDFhLs6icj3eGmI1N8hg5uMUoX6iFYBJhBRdBEqKzG1nEmwB1TJJ9Nh9DLwbo 6Ftg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738559087; x=1739163887; h=content-transfer-encoding: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=U0XFF68Xx7UsAf+ZoefRqNsk6j3jDoIMEeyAzHbO6rg=; b=F0RCKcwYG6vZvN46J3cUWeZYIz0JiFX/gDgfp55p2gsr/bPai3+E4edXkEvGJNqJnN qlEWm0XL9UlXVWGsSBTnLBKB7lOSYkaKbV3dLKBkvvSHgBVL2g38NQjVP7Bno3TL78Jf LdQ6ArBz5uRvJyk8RJMVZ/lMRqL6DBJuch6oLMwe+O03zEPT8/76cTe1HeR0kGfWfPPC TzNVX5CjEoR8gBTI9zzj2HiPXiKPa+Z6Px5EFi1jUFpd1JhDe0kmyJeOhDNTGSCb9Rga bTNz4Tdvba9mv2rXAdzznlMjuXqwBhJHb8Zii1cNz7sIcopx40s+IblVJAztPToDQLhj M7HA== X-Forwarded-Encrypted: i=1; AJvYcCWutNUBXQfHteRwy9U61uNkzwW8PIaxmDkSuME10UHIE60C6A99GvXFg4P3qHPgUyWv8QNS+fh+4Gll0wb+@lists.postgresql.org X-Gm-Message-State: AOJu0YyYPVEWaQjFuEUcl1QqYCuzvVGMegSD5Qq0PJGFfTjMmVY/8GI5 048/ebQe9eksakNBFdbJWxisxdzZb2UgcOizK57y+tXUbdA7VzgLT9XN127jskSmUY4TfxBkCnv mTP/G/k6p0EQRALqWWN8ul76LUeE= X-Gm-Gg: ASbGncvL/HLqaipl7P0s629OFuXP7N6X9qqZ4FJXgtwllgUGIrbnTBschm/hBJCWiiZ /HgyMUgHaGqOx1ejnRQd4CmXfkDDxoOlQUboXwpQgy0Cn5MPz0gbtBqj7s968JdXcrGliPzGxPA == X-Google-Smtp-Source: AGHT+IHdoVAyaPUoNMsikgX+NKcHX7rbar6NC6bi/thi0QmZfIGqIWl9A3+nMTDcUl6mBK/oMy+Kq8RSXdFC+u+KOOo= X-Received: by 2002:a05:6871:a011:b0:29e:6814:19d with SMTP id 586e51a60fabf-2b32f00e66dmr12893902fac.9.1738559086638; Sun, 02 Feb 2025 21:04:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Mon, 3 Feb 2025 10:34:35 +0530 X-Gm-Features: AWEUYZnMgmaFMh315YvnLA0Uu0fSRlxby1N2rn-PvN6mMMk7F6Fhfnc4-2Nfebg Message-ID: Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation To: Peter Smith Cc: Nisha Moond , vignesh C , "Hayato Kuroda (Fujitsu)" , shveta malik , Bharath Rupireddy , Ajin Cherian , Bertrand Drouvot , Masahiko Sawada , Nathan Bossart , PostgreSQL Hackers 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 Mon, Feb 3, 2025 at 9:04=E2=80=AFAM Peter Smith = wrote: > > On Fri, Jan 31, 2025 at 8:02=E2=80=AFPM Amit Kapila wrote: > > > > On Fri, Jan 31, 2025 at 10:40=E2=80=AFAM Peter Smith wrote: > > > > > > =3D=3D=3D=3D=3D=3D > > > src/backend/replication/slot.c > > > > > > ReportSlotInvalidation: > > > > > > 1. > > > + > > > + case RS_INVAL_IDLE_TIMEOUT: > > > + Assert(inactive_since > 0); > > > + /* translator: second %s is a GUC variable name */ > > > + appendStringInfo(&err_detail, > > > + _("The slot has remained idle since %s, which is longer than the > > > configured \"%s\" duration."), > > > + timestamptz_to_str(inactive_since), > > > + "idle_replication_slot_timeout"); > > > + break; > > > + > > > > > > errdetail: > > > > > > I guess it is no fault of this patch because I see you've only copied > > > nearby code, but AFAICT this function is still having an each-way bet > > > by using a mixture of _() macro which is for strings intended be > > > translated, but then only using them in errdetail_internal() which is > > > for strings that are NOT intended to be translated. Isn't it > > > contradictory? Why don't we use errdetail() here? > > > > > > > Your question is valid and I don't have an answer. I encourage you to > > start a new thread to clarify this. > > > > I think this was a false alarm. > > After studying this more deeply, I've changed my mind and now think > the code is OK as-is. > > AFAICT errdetail_internal is used when not wanting to translate the > *fmt* string passed to it (see EVALUATE_MESSAGE in elog.c). Now, here > the format string is just "%s" so it's fine to not translate that. > Meanwhile, the string value being substituted to the "%s" was already > translated because of the _(x) macro aka gettext(x). > I didn't get your point about " the "%s" was already translated because of ...". If we don't want to translate the message then why add '_(' to it in the first place? --=20 With Regards, Amit Kapila.