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 1taIUi-000YAr-5r for pgsql-general@arkaria.postgresql.org; Tue, 21 Jan 2025 17:56:56 +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 1taIUh-002twv-8i for pgsql-general@arkaria.postgresql.org; Tue, 21 Jan 2025 17:56:55 +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 1taIUg-002tud-UO for pgsql-general@lists.postgresql.org; Tue, 21 Jan 2025 17:56:54 +0000 Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1taIUe-000l6C-0V for pgsql-general@lists.postgresql.org; Tue, 21 Jan 2025 17:56:54 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 4C0BA2540193; Tue, 21 Jan 2025 12:56:51 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Tue, 21 Jan 2025 12:56:51 -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=1737482211; x=1737568611; bh=coPzRH0B3YhqHrn9UtZhqmDO3cyOmdfz9CpwGoFgxcg=; b= pMWpMPJtnmYR5ah3XfMYQl4uiZrP2Aow+CXApa9O864gV5E0u4rRT5yEkwR35dJu a/wSugtHf39eV/CHPkBcOQ5cjn2JMe7zZC3YEmjNdENpnWGOtqoQ8GC4aIZlSdAW xUhWVM8rdGHDVm1WD0Sog4ZC2PQDDpZksVdhBJdVGFgE7szKZHOwbWVs2L+qpdqq xOiS7YxWx5ZLnsaSrHvxqpt9lgf0zozdvBFWm/7Zg5fs+tTDWfS/WDcXvBMUTVfe w0FaTEpA+Myq6X8knEkQsv9PDzAimssY8YwKxLhGPfaFe1U1VQvX5HkPx/fpNCxO iUFA4LTulKxMOQKx9gB41A== 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=1737482211; x= 1737568611; bh=coPzRH0B3YhqHrn9UtZhqmDO3cyOmdfz9CpwGoFgxcg=; b=m cHryye19I9RzPO8MK/iodxCfDkIt0fSFKEF+07zRRUY3XlSGO+yxCK6WDsw+DRNb Nrlat+Y5r6AtKsP827FgBLMwv4zj0R/IoBKegmcQHUypLrWhQ0mIBXZ8W1Rp3MXD UHAc1otFyTCvAhw2GQu176A15ls8c7L5R5QVxhrVZliBqeoBx6aI4AG1RFJspXyv bzXYR5UphgRLwSWBCAJXcN1zcKVAOtFAJUrPR0QIGdDm6VjxeeWpMMmyAaw++s1f CP081lAwI51F9zOaEuoJAr8XfGBRNPjp5LkEuBEQRqfrUGdkTUyeEOtxJkKVbQMO SfSEUdbMR6TV0IRwqLGuw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejvddgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fuvfevfhfhjggtgfesthekredttddvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgv rhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrg htthgvrhhnpeefgeefieeutdfggfetgefgheekjeehteeileeigfetieekjedvieeviefg heevtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggprhgtphhtthho pedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehmrghhvghshhhpohhsthhgrh gvshelsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlhes lhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 21 Jan 2025 12:56:50 -0500 (EST) Message-ID: <79b7d5dc-3a1d-4ef0-9a3d-055268dc7d09@aklaver.com> Date: Tue, 21 Jan 2025 09:56:49 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Records count mismatch with logical replication To: Durgamahesh Manne Cc: pgsql-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 1/21/25 09:38, Durgamahesh Manne wrote: > > > > Hi Adrian Klaver > > Really Thanks for your quick response > > This happened during repack lag went to more than 350Gb then gradually > decreased to minimal lag after running pg_repack I don't use pg_repack so I don't know what effect it would have on the process. > > 3) Define how lag is being calculated and what 'minimal' is. > > postgres=> select > slot_name,pg_wal_lsn_diff(pg_current_wal_lsn(),restart_lsn) as bytes_behind, > pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) as > behind_size, active from pg_replication_slots; >   slot_name  | bytes_behind | behind_size | active > -------------+--------------+-------------+-------- >  cls_eva_msa |     22906216 | 22 MB       | t > > 4) Define how the record counts are being derived. >   Source : archiving=> select count(*) from archiving.events_archive ; >   count > --------- >  1262908 > (1 row) > > Destination : archiving=> select count(*) from archiving.events_archive ; >   count > --------- >  1252062 > (1 row) 22,906,216 bytes/10,846 rows works out to 2112 bytes per row. Is that a reasonable per row estimate? > > 5) The network distance between the servers. > >  Both are under same vpc security groups > > Regards > Durga Mahesh -- Adrian Klaver adrian.klaver@aklaver.com