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 1vc4DW-001kGH-0y for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Jan 2026 16:11:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vc4DU-00Cz4Z-1Z for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Jan 2026 16:11: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.96) (envelope-from ) id 1vc4DU-00Cz4R-0b for pgsql-hackers@lists.postgresql.org; Sat, 03 Jan 2026 16:11:00 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vc4DS-004Gkl-0F for pgsql-hackers@lists.postgresql.org; Sat, 03 Jan 2026 16:11:00 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-64b4f730a02so21392112a12.0 for ; Sat, 03 Jan 2026 08:10:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767456657; x=1768061457; 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=it6NSm2IR0p/edRY0u+2CNspyF7tTl/fr/OMo9uHr3E=; b=PfllStacHgRy2kTYdca9wf8n68IT4DjYuW5DPnVnaQT0gzqPgr33eHRXChc+YXWARu SNou6ayRHSHOQeuAYFNya7P4/vofy0XSg1y5UxKOA/ZVcnViwa/0mvCoum5XpqXh5isM bR4NIZcKwEn9PNJo/Uf7RlIf07DJh07Efn6vspctx8YOuaqHuiF/nMKkxTHDNvW0eUWN j7OPMmRzi3VW7xlk2ZYHELTgclmZLZygEWIDkTtBdqBYbO8d8OaOyuTE3wK8ccF088BU ha1iHI3NRWByER1DTdsn9fqJvJPeouYVJ/IBxO3Igm0gClO2whOnA635C7DJRB702TIY 7nTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767456657; x=1768061457; 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=it6NSm2IR0p/edRY0u+2CNspyF7tTl/fr/OMo9uHr3E=; b=fMANaSfB1IFjKlWqpquypgQdkt1tiAO2aXrYJ0vScSRfBqzjgDQENTCxZVE/G+sceD BL9MI8M+ta1tPqgRQCsWvyyfMmzUToyIrU+ftVGCkYbFNhYQM2Lc9cuXqJ3ImZOfa3Ow am/EG33dsHXSWxQ1Gzgf7NvBWBtvE4ezbIIecumUV3FX2NXo7LFNltwFSxX17PR5n9E+ 4yojXXQ9UcraDpoy5GqSOKbHJqQkqbLN0/IE3vmzs/GZ20swWd7TroWgXxuYC4DhAae3 k/N7yTq7j/6nZWVr9M4eGmoCvLcKq5nBQo1XPui+Qfj+sK6UuqUloMAgqFL3+Kz1yaJf I4uw== X-Forwarded-Encrypted: i=1; AJvYcCXe0W2bv96YEQIY7a2BpMFCaJ/mtSIUZsTxcDpWhEYK+hvaPeue24N+XlBxRLGQ3W2HI7Op+xL/13HR37LX@lists.postgresql.org X-Gm-Message-State: AOJu0YwGH9I3TrwoxGrPocQbmCu/q8oy8f6Fx9IXtlLlRcecKLttZtIf 2zhQfSIooDA1K/hnvenW0QxQg8HzYXr6B5mQe2pwgIPTWOjNKS4s2nAwmTe+OtdqC8eOz7vkxQG mulLY2x2ZaNm6MCKcDdZKhJUux2eRXN4= X-Gm-Gg: AY/fxX50ngdkUIutFaJsoSXGybNB52J8XQM9XJooTefDbzzaDMUoiKBNw4Rms1TQ8l2 30EpHvekpt/VDsnvbV9MyXDUg+FQ+x/xR1lJmuFP8ABaZYhdbc80uhJEZYIfymHX2UyNZdZiyLS QFoyoO6pxVbGOjJtBL/Hk4zi/zjBiY1wd0maXEDFEXkfpriVI6+9SCyfPh5geQlujdisnGWWl+u vPAdZmEbKsijtjaQb/geC9BL70avWlKG1Th6GuaxAXTDa3B0evSj0jSsXhJ2/cudbEtb9Q7OUio +S4TSCioJReb+bGVCohSFuSul2f3QDlOR1rwiK3diNy2Xtn1j+OS+JlzukcLbtmlTkRZhqHhhOQ VF6oK X-Google-Smtp-Source: AGHT+IE6Bf07aJI+dNyFn0JRP9ernhYE9OJa2TgBe3B5NQa4b2awGxiTGCC9CKCz2jBJCmSEReMRwMcWylQp8cqbZZY= X-Received: by 2002:a05:6402:350e:b0:641:8a92:9338 with SMTP id 4fb4d7f45d1cf-64b8eefc771mr41516288a12.22.1767456656677; Sat, 03 Jan 2026 08:10:56 -0800 (PST) MIME-Version: 1.0 References: <202601011659.ikh4ku4p3ovb@alvherre.pgsql> In-Reply-To: From: Xuneng Zhou Date: Sun, 4 Jan 2026 00:10:44 +0800 X-Gm-Features: AQt7F2pPIks47u0DeuHHWQwNFcqB52TwOIs3cU_bdVM_E63kvg21o4VzBc1AcpU Message-ID: Subject: Re: Implement waiting for wal lsn replay: reloaded To: Alexander Korotkov Cc: =?UTF-8?Q?=C3=81lvaro_Herrera?= , 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 Hi Alexander, On Sat, Jan 3, 2026 at 6:54=E2=80=AFAM Alexander Korotkov wrote: > > Hi, Xuneng! > > On Fri, Jan 2, 2026 at 11:17=E2=80=AFAM Xuneng Zhou wrote: > > On Fri, Jan 2, 2026 at 7:42=E2=80=AFAM Alexander Korotkov wrote: > > > > > > 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_QUE= RY_CANCELED), > > > > > - errmsg("timed out w= hile waiting for target LSN %X/%08X to be replayed; current replay LSN %X/%= 08X", > > > > > + errmsg("timed out w= hile waiting for target LSN %X/%08X to be %s; current %s LSN %X/%08X", > > > > > LSN_FORM= AT_ARGS(lsn), > > > > > - LSN_FORM= AT_ARGS(GetXLogReplayRecPtr(NULL)))); > > > > > + desc->ve= rb, > > > > > + desc->no= un, > > > > > + LSN_FORM= AT_ARGS(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 ne= ed 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 t= o be replayed; current standby_replay LSN %X/%08X", > > > > else if (lsntype =3D=3D flush) > > > > ereport( ... ) > > > > > > > > and so on. This means four separate messages for translation for e= ach > > > > 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 language= s > > > to have something like this. > > > > > > > Thanks for pointing this out. This approach doesn=E2=80=99t scale to mu= ltiple > > languages. While switch statements are more verbose, the extra clarity > > is justified to preserve proper internationalization. Please check the > > updated v12. > > I've corrected the patchset. Mostly changed just comments, formatting > etc. I'm going to push it if no objections. > Thanks for updating the patchset. LGTM. --=20 Best, Xuneng