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 1w2Jjq-000BRt-0e for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 02:00:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2Jjp-00EzGJ-03 for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 02:00:53 +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 1w2Jjo-00EzGA-2P for pgsql-hackers@lists.postgresql.org; Tue, 17 Mar 2026 02:00:52 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2Jjl-000000006sr-2eeq for pgsql-hackers@lists.postgresql.org; Tue, 17 Mar 2026 02:00:51 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-7d73ccee442so5488960a34.1 for ; Mon, 16 Mar 2026 19:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773712851; cv=none; d=google.com; s=arc-20240605; b=FtUdfBz0kPa5zZi/0sasYszfQ8cNRXCLgtDRauAYlQBPt6h3GJVLkrk5reNsINJz5n MwinMW2EwKmIhUeh63HhLrzaNExbNcJL1I67uac02P488EkJsTnftF840WeF9CayQQl0 TFgAPGwqKmYbxzz/ZSaVJfuN+4mvjNmFpglbjtnF5xAZG9Q9JBoVy1Phf84MTS5V0NCK KhVBKWz4QKO6XWwhpYe6Y9UhPuN0C+eW9acenES2aYNSt0CcN+YT4nRL+TJsIyQ+29z3 eVLgGWl8uRtwie4QQWXhsBwlLal9Nw58/lD336/CItis/QRSSz/wbJq61m8+3aLtV/e+ p7jg== 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=7hgrB3hT/2TrDykhPp31QQ55ZramN5xWofCGoVBxxjk=; fh=SprTjyyUNMFOaPK7zUpaC1EEovCYhXioP7Zs2WMpltw=; b=C23NgFmsFV/sDvlTclaGkrmEwpv+nfhYP1VvQ5PMNiJ+x7miETPywj9SHES0BVIUjL U6mxF7n9qHgiWpRGTvrXtp1MSvlONZoKgbE/mLE0BLL+JqQOcIznCExMBgKyIv1OISEX YydjOdFMqoVQU0k9GMpA+czhcF/qb6iMC/XCWbXor4cVKZBYyXm9Pw+j7tendIViRCv+ FN0Nv2Pl3kdjnsLskWc5QYQOGqL4YJd5AkFT0KJY5T0R4WLQkmUwObDcygXKzGE60sZY xxo/dUDNOk1XLEZBOpxIDmnSA+dxEl2a1g/v9U4c7DoUOygjhUy7T8Uq7JRHyX8V5NEE HfFw==; 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=1773712851; x=1774317651; 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=7hgrB3hT/2TrDykhPp31QQ55ZramN5xWofCGoVBxxjk=; b=KSAB7oKg+p1UgwiaoUfVFy4RNIB8/BJsdmdsrJZChwo8sNCmXYFmscP+zxYsDWYMS2 AOGCAN9TDk9gbNY8MyaDsr2zDYsTVdtR9ueeinsuDKECD36zZsT4pgTmzmhV8ni1uEff zGsdI9vJ2no474RISWzXbhd+SLh+o7q2BHXb5YdoHGHde1lgfpmVV6mG5aP1NTzBf9Wi J+/S8w2hv34ppn6s7PRTEkGAuMdHHa7XKQX3AEj236rRXMZRjm5TQLwpEmDpiT0RCz6w 56YgOAUrP0rxPuS7JkjCTorUGL6geAtWnFTACU1pvMjcAGr9TanzwqyumIwuByvrKRwP iPRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773712851; x=1774317651; 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=7hgrB3hT/2TrDykhPp31QQ55ZramN5xWofCGoVBxxjk=; b=SmA0QyShj9hNF9Q25BF/BT6PdzLGLsXvqKrv++J5jy2XcrRtBlGeKwR4LGMSXUpayR ufsCty81sGdIdfOkBE8YSw6L+jFFGDmi/YC29uaZVTzr4EsTIBKH6J3PrvTplnd+xcW9 QjnpsfTyX+lknYONCntxxtZMNP/tCn1Y6kq+kS9fWLgHpVtsdzR4hiUEkwgYAGYDM2tg WESDdYyzE7gsOUJECzwT8CwOwGinBiko98IpwLayZrRcxcYYyYfLhNTvAS1UUpJ6UbSx pMUztQ4/loJlEAeCg9LbSKsHGM/SBNsjdyBK7SHZN1V4JBd8bX310ZvsdUNKtyaHHi7g o30Q== X-Gm-Message-State: AOJu0Yz57gsV6B92j2E/gK9fx2hJHFD/FRVFJjWitXoeUu4T2ESttZWj uonEkJZTbDxkTBWu9YLlxtQIR5sPpDwMPddu7MWEyyNqzHrZRi+GCMeOZ26A6FpuLkI6Z+Sgmna mxW/2ceKzViPITdwo7pkBjNBKj2rgEM8= X-Gm-Gg: ATEYQzweVAW4ZH1w7HOzwbzTIAU8a9EJ62SeBWo/b1ohA0swfS9ORG7uzipTO6mSMiK wz3W0JCi9aS4Uy1sxRdl2Vp5/5YRw+TFJ6dMO8DZjJrnTNeIbyMC0kCJpl2kuwLR1aEay/KrKex wx/O9KiAMkQwgfvMpSlj/JGWIS+4EgsmC2OD8Q0Lz+Ne/zXrqJsFcR2I1Ylo2Jgn6uZtlqlZdH5 awnZrtM3DzQ60AqbPLB7Y3xUXpukdsa/DFWew/3IjQE/x6XSUUIgw0aNIkKKlWT9V1Cnxn/nnEW 4agIzRsmB5O310mVBkZGbzgioveg8flgGEjY46M= X-Received: by 2002:a4a:e916:0:b0:677:cb1:37fd with SMTP id 006d021491bc7-67bdaa6d88emr10843519eaf.58.1773712850595; Mon, 16 Mar 2026 19:00:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Fujii Masao Date: Tue, 17 Mar 2026 11:00:38 +0900 X-Gm-Features: AaiRm513wz92S43Q6efJ8lyokJheELgXApG0V5l-pz-ScI3YXTPNoiAT68w_sEQ Message-ID: Subject: Re: pg_stat_replication.*_lag sometimes shows NULL during active replication To: Shinya Kato 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 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 differentl= y, don't you? Sorry, I failed to understand your point... Regards, --=20 Fujii Masao