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 1ol6xM-0003gG-Hm for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Oct 2022 11:09:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ol6xK-0005Kg-PT for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Oct 2022 11:09:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ol6xK-0005KT-EM for pgsql-bugs@lists.postgresql.org; Wed, 19 Oct 2022 11:09:50 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ol6xI-0005Wb-Hj for pgsql-bugs@postgresql.org; Wed, 19 Oct 2022 11:09:50 +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=E/k+VLlqgJRtUy4aDjG6IOsRTYNIWdfYJJPVzYtIaOk=; b=m41hCR+ywH4PYQVYE1lTUeOWQ5 XoDJcwL5YkQ3HVY66cPpdqfmfosjGGMYqUVTkbkg82qAR1bMWJKeOvftCJQUTPIcfGQ3gmQQ0iF6I nPnDgFAAnHH6Wcu5ZsoadOj3BGAscdv8lZ+vLaKSzBm20ykyvFkN2Zjm0V/FhZRDVcV4=; Received: from depesz by depesz.com with local (Exim 4.94.2) (envelope-from ) id 1ol6xG-00FJmq-RP; Wed, 19 Oct 2022 13:09:46 +0200 Date: Wed, 19 Oct 2022 13:09:46 +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 Wed, Oct 19, 2022 at 04:14:28PM +0530, Amit Kapila wrote: > One idea is to change log level to DEBUG2 so that we can print which > files are removed by the server via > RemoveOldXlogFiles() > { > ... > elog(DEBUG2, "attempting to remove WAL segments older than log file %s", > lastoff); > ... > } > > If we can do this then at the very least we can know whether the > required files are removed by the server or by some external > application. That should be doable. Will take some time to setup test env, and run it. Will get back to you on this. Best regards, depesz