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 1olU8z-0007I0-8Y for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Oct 2022 11:55: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 1olU8x-0005li-NZ for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Oct 2022 11:55:23 +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 1olU8x-0005lZ-DK for pgsql-bugs@lists.postgresql.org; Thu, 20 Oct 2022 11:55:23 +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 1olU8u-0000Ux-KG for pgsql-bugs@postgresql.org; Thu, 20 Oct 2022 11:55: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:To:Sender:From:Date:Cc: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=ImixozqV9I2Qa1iInE8bdNJaXKV91qhhE89Zvji+9/E=; b=XnUraGLaspiSFkzSfdqMQdUKUc mc0Ot7ZaCCw58kgG5TaEc5IHo8mt6N/7ssSd+FKfiKAdtJD59rugD7Q6ri/ub0Mht6c27DNlB8VZU /Tb5EnQYTIgh5MZZ5Jraw3JkBdsiieCuiqxvuXNg7GU60tEEDvrL0fPdJKhgpjXcaqOg=; Received: from depesz by depesz.com with local (Exim 4.94.2) (envelope-from ) id 1olU8q-00Fz5E-No; Thu, 20 Oct 2022 13:55:16 +0200 Date: Thu, 20 Oct 2022 13:55:16 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Amit Kapila , 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 Wed, Oct 19, 2022 at 01:11:06PM +0200, hubert depesz lubaczewski wrote: > 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? > > We're not. We're on 12.9, and there seem to be some wal-related changes > since then: > https://why-upgrade.depesz.com/show?from=12.9&to=12.12&keywords=wal* > > will talk with responsible people about upgrading it, and then redoing > the test. Hi, just an update. Due to procedures we will upgrade to 12.12 at the beginning of November. Then, I'll try to replicate the problem again, and we'll see how this will pan out. For next test will do my best to use debug2 log level. Best regards, depesz