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 1shVoi-0031gK-Ho for pgsql-general@arkaria.postgresql.org; Fri, 23 Aug 2024 15:03:09 +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 1shVog-00EN5H-35 for pgsql-general@arkaria.postgresql.org; Fri, 23 Aug 2024 15:03:06 +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 1shVoe-00EN55-83 for pgsql-general@lists.postgresql.org; Fri, 23 Aug 2024 15:03:06 +0000 Received: from fout3-smtp.messagingengine.com ([103.168.172.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1shVoZ-00189Y-Fg for pgsql-general@lists.postgresql.org; Fri, 23 Aug 2024 15:03:04 +0000 Received: from phl-compute-05.internal (phl-compute-05.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 401B9139003B; Fri, 23 Aug 2024 11:02:58 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Fri, 23 Aug 2024 11:02:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1724425378; x=1724511778; bh=bZrlxBHm5oHymRss6yM+n2C+4GIl0UEQwbSvHLWsou8=; b= PeOehdEGJKtBBtuqm8Je5EACfoCtkleSAkEjBQmCHfWOGr7ns4EpZrtqPJZacur5 /sU8fNxRXGLXPks+Z56GppbODq5FnorbZHEEtYjuJIYJ3uTa200xsYdmBtWMxiOw uXDCmBnc3v59QUlgo+JMHbHg4o0nMd312Gp3EpjCASFw1ghc7BK/ELwbBQXUcgxV gCjZ3eniXt6s14PoGVWA4m/j471F8+KoXLniy3n72e75m8ONhpm5sesMemOMSVk4 6SAVVjXeQU1RmcAjuNxnBIwea9Scjsh9Wp3fG+TmEzaWxaeG/yPLyevsz71qvUk+ XQN6rhgTfYbWxq0zu4qqsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1724425378; x= 1724511778; bh=bZrlxBHm5oHymRss6yM+n2C+4GIl0UEQwbSvHLWsou8=; b=Q 7cppaYlIK14gxGm/1jqfLtIfcb1Q/XDdEkJxEmZdu4Sqv08yDN7mo36Txu7fmp+1 i9a9yuYs9OmhDEJC/q6hduONrQe8jmeONjtxKQHvJqgAIW4SPqttDxp+KLpgNrVh evsg1Fi5PeQitOD9x2OWxO8qSI3iJZLQftEKkqKy9LEhj2zlrc/bN/RDqnIOf438 QMBP+4Dk7y9iUjBQoWDMAIegIRxdlTs3283MgZGdDIGnJrSp0c/+Gbjn5V2CTt0g pDOAuf/XfjVzLtatP0FR+8nZ4vffv9e9beDp5V5eOLjqFK/rqwibJb1hBIEhvxGW 1uJ566gWxDu3P/l2hNP2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddvvddgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeen ucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeelgeevkeekkeeuiefgtdev ieeluefhfedufeetkeejffekjeeujeehgeehgeektdenucffohhmrghinhepphhoshhtgh hrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspg hrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepkhgughdruggv vhesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehlih hsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 23 Aug 2024 11:02:57 -0400 (EDT) Message-ID: <65d55d32-c9c3-4446-a367-d3cca3282dea@aklaver.com> Date: Fri, 23 Aug 2024 08:02:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: On a subscriber, why is last_msg_send_time in pg_stat_subscription sometimes null? To: Koen De Groote , PostgreSQL General References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/23/24 07:33, Koen De Groote wrote: > I'm running this query: > > SELECT subname, received_lsn, latest_end_lsn, > last_msg_send_time, last_msg_receipt_time > FROM pg_catalog.pg_stat_subscription; > > And "last_msg_send_time" will sometimes be null. All I can find in the > documentation is that this value represents: "Send time of last message > received from origin WAL sender; NULL for parallel apply workers" > > But I have no context for what parallel apply workers are or why they > are NULL sometimes and other times not. > > Can anyone explain? The source has that information: https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/replication/logical/applyparallelworker.c;h=e7f7d4c5e4bd3ff63687cb21b84534a05a3962cc;hb=HEAD The top part explains the process. As to the time: /* * There are three fields in each message received by the parallel apply * worker: start_lsn, end_lsn and send_time. Because we have updated these * statistics in the leader apply worker, we can ignore these fields in the * parallel apply worker (see function LogicalRepApplyLoop). */ > > Regards, > Koen De Groote -- Adrian Klaver adrian.klaver@aklaver.com