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 1taLzh-0017lc-DO for pgsql-general@arkaria.postgresql.org; Tue, 21 Jan 2025 21:41:10 +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 1taLzg-006Hb1-2D for pgsql-general@arkaria.postgresql.org; Tue, 21 Jan 2025 21:41:08 +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 1taLzf-006HYs-6M for pgsql-general@lists.postgresql.org; Tue, 21 Jan 2025 21:41:07 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1taLza-000msD-03 for pgsql-general@lists.postgresql.org; Tue, 21 Jan 2025 21:41:06 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id DCB19254022E; Tue, 21 Jan 2025 16:40:59 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Tue, 21 Jan 2025 16:40:59 -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=1737495659; x=1737582059; bh=yEb2sv3c59a34dW9+dhn+C6eIIT+ZQoOBXQLS8x8OIo=; b= EUF8QJxG+YMzVe/XsJhGXohoom3pYvacIcrYVKUdgWfGWlMZgdTxMiMEYEtkK+7S Nt9qXX0YjDmqMWsHUo6W3pShANsOHF9lDq5OvGOkxRqqHOwTBB4sgfXykPflD7nr dMf5pBiZ7UuSPR53oVDQGwVQ+hBmfgddaLIHJFec8cUCuKi8gSQUpHtXRbDJSvz5 JN/+esp7jlmpqdJgXxtDSgTJIeWxUa4dbPnNS7AoSPG6Zudo1h8t9U0YAPDCCDjT T9kzTTiKJcuzphQPc3hfhAD1Qi3AjLARJUjbozTvpM4/aFbXnc/aH+Xmrf8d9vVT 0lXNMnlo6kZ0BFRITXQgSQ== 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=1737495659; x= 1737582059; bh=yEb2sv3c59a34dW9+dhn+C6eIIT+ZQoOBXQLS8x8OIo=; b=P Dtcgbognuc767ktkVHA5Vg02ynOBS1XjoJsQXX714Xlupt/KikFVd7L7QDbf/tDS gMd8gLFtPEBjbzcNZpAHPj0jeZU1bl4P/SHnPyntrG6+P+39zWT9/0f4CdRqeN9/ p9dQFLZMh8zhBuZOpAa8zgv3yiW1pEhQrMGeWZpyA4MJjuvnsdVdv9fms/I34+ig X/FImZxMCwZDd5qOYWJh0XE9Ue/QOhFNfVGAgvWWdMDg1I1scnZkXh03PDiXZno6 9Dsi0DlbWKHwUHRr4UkB+nKIOB5qdHqnT/VuVGegrqXN3+lvhKgrmpVBBj0/Cyca okH9D/ffQG0+q5Ees6aIw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejvddguddvudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgg gfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghv vghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrf grthhtvghrnhepjeekgeethfefgeehheekudekhfefiefhteekudektddtieevjeekleeh hedtteffnecuffhomhgrihhnpegrmhgriihonhdrtghomhenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegr khhlrghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopehmrghhvghshhhpohhsthhgrhgvshelsehgmhgrihhlrdgtohhmpdhr tghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhrvghsqh hlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 21 Jan 2025 16:40:58 -0500 (EST) Message-ID: <44e3ca5d-fcbd-4f96-a6a6-09becff15cd7@aklaver.com> Date: Tue, 21 Jan 2025 13:40:57 -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> 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 1/21/25 11:40, Durgamahesh Manne wrote: > > > On Wed, 22 Jan, 2025, 00:22 Adrian Klaver, > wrote: > > > > On 1/21/25 10:06 AM, Durgamahesh Manne wrote: > > > > > Hi Adrian Klaver > > > > 22,906,216 bytes/10,846 rows  works out to 2112 bytes per row. > > > > Is that a reasonable per row estimate? > > > > Yes  sometimes would be vary > > If I am following the lag went from 350GB behind to 22MB. > > Is the issue that the lag has stalled at 22MB? > > > > > Regards, > > Durga Mahesh > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > > Hi Adrian Klaver > > Is the issue that the lag has stalled at 22MB? > > Depends on load of source > The lag would be either decrease or increase in Kb 's and Mb's (not Gb's) > It s not constant as Data being replicated to target Previously you stated: "Both are under same vpc security groups" Does this refer to AWS? If so per: https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html "The following diagram shows an example VPC. The VPC has one subnet in each of the Availability Zones in the Region, EC2 instances in each subnet, and an internet gateway to allow communication between the resources in your VPC and the internet." So where are the two Postgres instances physically located relative to each other? > > But records count varies with difference of more than 10 thousand Have you looked at the I/0 statistics between the Postgres instances? > > How to mitigate this issue in simplest way ? Until it is determined what is causing the lag there is no way to deal with it. > > Regards > Durga Mahesh -- Adrian Klaver adrian.klaver@aklaver.com