Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ol6BV-0001Cw-Aq for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Oct 2022 10:20:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ol6BU-0004zI-8G for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Oct 2022 10:20:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ol6BU-0004z9-04 for pgsql-bugs@lists.postgresql.org; Wed, 19 Oct 2022 10:20:24 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ol6BM-0004b3-Uj for pgsql-bugs@postgresql.org; Wed, 19 Oct 2022 10:20:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YsrQ4TUGmmiYKxaLUtERTBN+Cj3WUJ/UI/Kb4dFTCxk=; b=n1RAs/BE98gpwYG9nYuprc7ERo k71Zr2W+KF1mE8B90K8m1OA8UFO3JvZO4+bT1+pz+MYYoxOJL3silYlxH2A+UpT3V2FaOI0Qi+GqY 9uzbxJVOzWPWZT3tteXzqjQ8wwVUxseIUeN1YHd5CpkIhfbMC8x5ox5pzn2wWpJG12SY=; Received: from depesz by depesz.com with local (Exim 4.94.2) (envelope-from ) id 1ol6BJ-00FDtn-Au; Wed, 19 Oct 2022 12:20:13 +0200 Date: Wed, 19 Oct 2022 12:20:13 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Amit Kapila Cc: pgsql-bugs mailing list Subject: Re: WAL segments removed from primary despite the fact that logical replication slot needs it. Message-ID: Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Oct 18, 2022 at 04:57:52PM +0530, Amit Kapila wrote: > On Mon, Oct 17, 2022 at 2:43 PM hubert depesz lubaczewski > wrote: > > > > On Sun, Oct 16, 2022 at 10:35:17AM +0530, Amit Kapila wrote: > > > > Wal file has been removed. Please note that the file was, as shown earlier, still within "restart_lsn" as visibile on pg12/bionic. > > > This is quite strange and I am not able to see the reason why this can > > > happen. The only way to debug this problem that comes to mind is to > > > add more LOGS around the code that removes the WAL files. For example, > > > we can try to print the value of minimumslotLSN (keep) and logSegNo in > > > KeepLogSeg(). > > > > That would require changing pg sources, I think, recompiling, and > > retrying? > > > > Yes. BTW, are you on the latest release of pg12, if not then you can > once check the release notes to see if there is any related bug fix in > the later releases? > > Is this problem reproducible? If so, can you find out why there are > multiple time connection issues between walsender and walreceiver? I can try to redo it, but before I do - anything I could do to either side of replication to increase our chances at figuring out the underlying problem? I can't restart pg12, though. Best regards, depesz