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 1w3Dtr-0011LE-2x for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Mar 2026 13:58:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w3Dtq-000E1P-0p for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Mar 2026 13:58:58 +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 1w3Dtp-000E1H-38 for pgsql-hackers@lists.postgresql.org; Thu, 19 Mar 2026 13:58:58 +0000 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w3Dtn-000000000vm-2WfK for pgsql-hackers@lists.postgresql.org; Thu, 19 Mar 2026 13:58:58 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-89c4f7f8650so17720676d6.0 for ; Thu, 19 Mar 2026 06:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773928734; cv=none; d=google.com; s=arc-20240605; b=lSeCc2iLZT+/iW+PegLO7Y0JuJxzDg91lgBWHm82KL2HGarmwgAqo+QRu7HhKqf7BT YPiq+JQJfPaGvSlcqyO8UDXv9b/R0UA7uY5bQRVDLbJncvZLnqV6sNA9TXeXxn/u/DXq Cd31HQu5hlzKVHaeCH6kpxvyqhzmHwC9d+eVOLTt07IIpSRf7sutYc1qmyMf0UCyGTNg 2D1S8rUhAOYXceJeVEaNYPIaWI4uxNpL5bmCyBXwB646zly3QFuqelPxIPQqFlA4v4Vf uCOmW5geua4MPLX9zofrXTt7AaYiznwJBkYelaumKOB9sUMH2NLG23avnt8YRdHQW16w b41g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EkeKQiQpBUCcoA6q12L+gPLztRdOD+eX9jK9JEoL3ZA=; fh=x4xgi4tdDukVB0fBuAIe3vORvD36rbbTBlhrrGN8QbM=; b=RZnwagbEf0Z2ePrUGL+9LEG52ihnqgbU6QJVxaKtM0JCS0SlmiHe9TfnMHYG1kP4bs 5JsleE0bxEiJG9X2ROkzp4rm6niixfB8bsvKglRqUtwXb8Rsr5miNPuDgP5Le0rq4gkv QDrKTRPsFiynWzPGse1LwyQy9HnGcIKXg9u22k4qEfZUYbeRYkZRS+EOcSDnVd3iBc18 mS/Ls4hcuAVM/OPLA14+L4UFThzFcmjk74DNiDu6g99LOABhEQeO8E8X727te+VYBDS8 zRIdRvgeLKKe2OEwy+G4mhovi50upUw/jCetqqwIjZB1ElXjIZJ73UrU55wpygazmJWD /deA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773928734; x=1774533534; 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=EkeKQiQpBUCcoA6q12L+gPLztRdOD+eX9jK9JEoL3ZA=; b=l7zX+oF3EiJVoKNN0M9Y4ym35BYBKpEL/zlw0ZWeFLNneFQ0OlcNXvZAGhjCKB15Ga rCJ4ia7z0/+/rRMbweVbzZ1smFDPEwbCcZhQL6BFsmrpoqWofxi6Q5ndMAqw0OY4MhHu 3EmOjL9VGSiPjTXAZp4OcDWp5YEVTLmuM4cf7ONq1yie+lMZp4OqcnfBNPBIibnj+tgw vvuE2vVEw462BeZVKae+IVjL8IKdFKw441uQ0ik4AwN59zNk/l+4R2VsuieKbx26dD32 nMNu1p9cuQ36Hgw9UGqPNZFZVqRvhQ4LyD5hP/LEshDp4Fzpo/GlahJhXJqHxJmlK0fz 20IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773928734; x=1774533534; 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=EkeKQiQpBUCcoA6q12L+gPLztRdOD+eX9jK9JEoL3ZA=; b=OdMLGajxvu/IkDDgsuV5iHTe6CDHyFr8cZTXdDa7D2G45DMgNv6XqNd0XNystlhWnk oNM8QHhlgMSa95ltd0HVnsPIcG7IoUnY7RL+hGzLLpjUMtALBguw4HqpR2DrVcJUONHP AW58EaQ4FD0lvwGa5D6vZXtrdphS7yTXNUUtK2r14tg5LzIxh9qR6Lmo8NBMwXDz7R56 5D/UN0BeMyWEabI0El4RVnBsBLPKBNnQSupLlakjtpp2KTF3ye/uy2xbQfhsNFlVNxdN R6KZQ/zFCcj38JGPMyrz9vipTDg3OtZvORv086J1Czxw7CuJ6SsJ2gKAM3ei2yifUmhx 7SBA== X-Gm-Message-State: AOJu0YyCVdNmVIrUN8rPOJ45AL6PmBM9CEzGp1EohuArSlTA/q3Y4+bL eF/q1u9JR+tpgc3Nfd+69oo7L6LV07032VXKBlcva3PlW0YG8Wgs08Ouq2DLAl9fshoYRm/Flin hexVfRUnuXd6BZ7pPKac+OaFSNjes3g== X-Gm-Gg: ATEYQzyGYp5Ko71l4ziS8fbfyyvsBO3uYM0EDg9etH5KVe0sAnFmIG5Beo23AqnXZre Yc8rezI54F3z/D8ORapqNhdVxeby6LVGeQDel87bKptp2ULw0BHPo71088GPjBF+HbQdj3ySxDN se6LMxABR97W27f/speiaV5yYZkWuMbDLk6Fao/WgQZujlkJwxLT74Kr9M8dxWoFn4Z6oGZAULI WEPHdmExDmWNM+teojkdTWaZS+xCgVWFDL6hN6OoM4wr1GkZg+rXrMnfZChjzDdtjMm7BA/17E5 Nunhg0304lqDscxO X-Received: by 2002:a05:6214:5081:b0:899:fcce:b1f7 with SMTP id 6a1803df08f44-89c6b596b40mr106466086d6.45.1773928734365; Thu, 19 Mar 2026 06:58:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shinya Kato Date: Thu, 19 Mar 2026 22:58:18 +0900 X-Gm-Features: AaiRm5310H8PLoaD-m62iCn-Y8URqxyhsx02dM8swWrWCj6v7qrdzQyWxJaCB3s Message-ID: Subject: Re: pg_stat_replication.*_lag sometimes shows NULL during active replication To: Fujii Masao Cc: 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 Tue, Mar 17, 2026 at 11:00=E2=80=AFAM Fujii Masao wrote: > > On Mon, Mar 16, 2026 at 9:26=E2=80=AFAM Shinya Kato wrote: > > Thank you for the v4 patch. I think this approach is better than mine. > > I tested the patch and confirmed that the issue no longer reproduces > > with physical replication. However, with logical replication, the lag > > columns in pg_stat_replication still show NULL periodically at > > wal_receiver_status_interval, since send_feedback() in worker.c can > > still send duplicate positions. > > I was thinking that if a feedback message triggered by > wal_receiver_status_interval has the same LSNs as the previous message, > it's expected for the lag columns to become NULL. But you see it differen= tly, > don't you? Sorry, I failed to understand your point... Sorry for the confusion. I ran a script inserting one row every 0.5 seconds under logical replication and confirmed that NULL still appears in the lag columns even while replication is actively running. I was initially mistaken that this was tied to wal_receiver_status_interval timing =E2=80=94 that turned out to be unrelat= ed. I haven't had time to investigate further, but my current impression is that the existing approach may not be sufficient for logical replication. --=20 Best regards, Shinya Kato NTT OSS Center