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 1tb0DY-0076jn-U4 for pgsql-general@arkaria.postgresql.org; Thu, 23 Jan 2025 16:38: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 1tb0DW-000Z9b-SQ for pgsql-general@arkaria.postgresql.org; Thu, 23 Jan 2025 16:38:06 +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.94.2) (envelope-from ) id 1tb0DW-000Z9T-HS for pgsql-general@lists.postgresql.org; Thu, 23 Jan 2025 16:38:06 +0000 Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tb0DU-0017eG-1K for pgsql-general@lists.postgresql.org; Thu, 23 Jan 2025 16:38:05 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id A78A2254016A; Thu, 23 Jan 2025 11:38:03 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Thu, 23 Jan 2025 11:38:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc: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=fm2; t=1737650283; x=1737736683; bh=YyxUx/hcEo851xkQ9fg+3wGxlVWhKrTwsIC0RjqUFVI=; b= F8EjT+Mim50J0rRbPvliyGpPbb8HtJDFCnzTteYU9EsD8jzpzLWv9DSfI8Q8/xWN 6eNJJ9QWCq2lkU4TY+LIjR+h/3WPscLpBS36xHOX5/PsQRcoHODQmWDSOFDovoMH boF6opxrSs1qLsmpS20uzgQWbGBqevuZB8gxttcV/UqhtV6g7l2cNiVREurXHCqG 1DFjrZSxQQAkrbjbCYj/eI0e8vu4w2Z1VCXQLs0Wz8SYO4isr0ofp/uALCxXFboj 92zec0ZjyA5PifSQjC7nKrtz47V4LcFnTcj+uLSdeLnDIzzCBCdUthJSe5bXsW6q NrAESCWciY83neoaCPi/TA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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-sender:x-me-sender:x-sasl-enc; s=fm3; t=1737650283; x= 1737736683; bh=YyxUx/hcEo851xkQ9fg+3wGxlVWhKrTwsIC0RjqUFVI=; b=L fqet4FDbE0cbK0S3UExN7AuezJgm/lCIYQv7KGz/Q8sK/jtuG/TE4Po5gq4Iwx3V UjHJ+NVn5csqgD7XJamWxWzd5TJ5xcxpLDs75HeZtjgbZxTZolVxun3kSlW+JzaW OUYyR4Ykg/35SnPNErUMGzaTzF7T1atRDlHW/EFNLOZ1Y9veQ9uhVGh7vwiq9uAH QQ/CpmvmXW6WvFzsxhfoLVwEgfcT7gn+YG5UIrr6kFyvtPDeKqdjago0TH/nywbe 1RlyKJGMKJrEodtUY394d2HwHwzJkirMcxPRrTOOKTKRFbQ+c99HOUl1SAtcLPcY JFUJ5bwvGpTV2ClIHz6Mg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgvdduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgg gfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghv vghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrf grthhtvghrnhepuedufeejjefggfdttdeghefgkeeuveekkeeiteettdekffehiedvtefh veffgeeunecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghv vghrsegrkhhlrghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmth hpohhuthdprhgtphhtthhopehmrghhvghshhhpohhsthhgrhgvshelsehgmhgrihhlrdgt ohhmpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtgh hrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 23 Jan 2025 11:38:02 -0500 (EST) Message-ID: Date: Thu, 23 Jan 2025 08:38:02 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Records count mismatch with logical replication To: Durgamahesh Manne Cc: pgsql-general References: <79b7d5dc-3a1d-4ef0-9a3d-055268dc7d09@aklaver.com> <3691ad0c-189c-4290-a434-e03cb6301cac@aklaver.com> <44e3ca5d-fcbd-4f96-a6a6-09becff15cd7@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/22/25 18:53, Durgamahesh Manne wrote: > > > > > But records count varies with difference of more than 10 thousand > > Have you looked at the I/0 statistics between the Postgres instances? > > Seems everything looks good with pg replication slots Except the subscriber is lagging behind the publisher. '... everything looks good' is an opinion not actual data. > > Does this pg logical slot get changes function help to pull pending > changes to subscription that can be sync with publication server for > real time sync ? Are you referring to this?: https://www.postgresql.org/docs/current/warm-standby.html#SYNCHRONOUS-REPLICATION Though I am not sure you want to do this as from above: "When requesting synchronous replication, each commit of a write transaction will wait until confirmation is received that the commit has been written to the write-ahead log on disk of both the primary and standby server. The only possibility that data can be lost is if both the primary and the standby suffer crashes at the same time. This can provide a much higher level of durability, though only if the sysadmin is cautious about the placement and management of the two servers. Waiting for confirmation increases the user's confidence that the changes will not be lost in the event of server crashes but it also necessarily increases the response time for the requesting transaction. The minimum wait time is the round-trip time between primary and standby." If you are not referring to above then you will need to explain further. > > Regards, > Durgamahesh > -- Adrian Klaver adrian.klaver@aklaver.com