Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hXsxM-0003RY-Cd for pgsql-admin@arkaria.postgresql.org; Mon, 03 Jun 2019 19:49:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hXsxJ-0001Oz-Qc for pgsql-admin@arkaria.postgresql.org; Mon, 03 Jun 2019 19:49:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hXsxI-0001Fc-Ef for pgsql-admin@lists.postgresql.org; Mon, 03 Jun 2019 19:49:17 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hXsxF-0002Fe-E2 for pgsql-admin@postgresql.org; Mon, 03 Jun 2019 19:49:14 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 13415799; Mon, 3 Jun 2019 15:49:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 03 Jun 2019 15:49:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= quadratum-braccas.com; h=to:from:subject:message-id:date :mime-version:content-type:content-transfer-encoding; s=fm2; bh= wJBCzSW89D6P3Gx4b8GDfVbEFsBhM63eDPer9VBZRwk=; b=NrN6jMN5a95KtaVn opuDJc9jzx4nHjM/gDeMm0pH9dYtI4JmQw8Mcpnla7kUyN+YKcJbC3vO5Eqpt6Gi qebCNCy7ZjcnWecc4ABIFKFN/XQXkWxG0+Pl4bighSVrHAp3ILhs/i/YoDk+wTEG 635Pkx7zPFkArIhaKkcQVcFtUAiEViqS560S6K65GZXnI1uKFOAK50EiMm0h0uVb WB0PMvPRaN+Mr4gZlHSuS6+m9iD9f+iL/YB51Mm5ca3a6b43ZMUamJTGQp4wTuny JokXrDKt2df9pyqXPso2S1q4ugpY5ti15zEDfq0QcCPZl7t4jNKP/Wz+fqmiSLy7 RUj52A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=wJBCzS W89D6P3Gx4b8GDfVbEFsBhM63eDPer9VBZRwk=; b=T1iVO4Nrfk+E0fAC/U470d gjgG1ldNvMUZta8TGd3o2f0+HLAGyZ1MFwOHEclzej7DmCk+XiD7AloQJTqNAV5T HAEcNAVp9lWr8lsEylGGBRWx9aQcw8Z/NX7E9mETTAkfvgKwR1CKou26Pc9g6lqC 81Q3KsTOHWaE4YGmGFrS/SJWS6f/GwKxOVA+n0NIuC1ZEJnK9YVm2f7TgOC6NMz3 HMtvydwpRBuLYx0o4g4yxuzz2D/JNkq/ErquNjUGMrjaiGw/OzJCBNULAWGoyoOn zGZTP0lMKsZ8VYiAaJij/d8S67qOHCzdfL9TTqaMwj7kLledV2lwM2atIZbwcVJw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudefjedgudegtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepvffhuffkffgfgggtgfesthekre dttdefjeenucfhrhhomhepfdfurdcuuehosgdfuceoshgsohgssehquhgrughrrghtuhhm qdgsrhgrtggtrghsrdgtohhmqeenucfkphephedtrddvgeefrdduhedtrdekudenucfrrg hrrghmpehmrghilhhfrhhomhepshgsohgssehquhgrughrrghtuhhmqdgsrhgrtggtrghs rdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [10.16.0.137] (50-243-150-81-static.hfc.comcastbusiness.net [50.243.150.81]) by mail.messagingengine.com (Postfix) with ESMTPA id F2D1A38008C; Mon, 3 Jun 2019 15:49:10 -0400 (EDT) To: pgsql-admin@postgresql.org From: "S. Bob" Subject: cluster with a logical replication slot not recycling WAL files Message-ID: <3cb0b58e-71bf-d123-05d9-c2c904e683eb@quadratum-braccas.com> Date: Mon, 3 Jun 2019 13:49:10 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi all; I setup a 9.6 cluster with the following: archive_mode = on archive_command = 'cp %p /var/lib/pgsql/9.6/wal/%f' archive_timeout = 60 max_replication_slots = 5 wal_level = logical Then I used pgbench to initialize the pgbench tables Then I started the cluster, connected to psql and created a logical replication slot: select * from pg_create_logical_replication_slot ('slot_a', 'test_decoding'); Next I generated some pgbench traffic and retrieved the traffic via : select * from pg_logical_slot_get_changes ('slot_a', NULL, NULL); The pg_xlog dir was recycling wal files as expected, for some time there were no more that about 5 wal files in pg_xlog. Then for some reason the cluster stopped removing wal files from pg_xlog. There are no additional transactions to consume: postgres=# select * from pg_logical_slot_get_changes ('slot_a', NULL, NULL);  location | xid | data ----------+-----+------ (0 rows) pg_replication_slots shows this:postgres=# select * from pg_replication_slots ; -[ RECORD 1 ]-------+-------------- slot_name           | slot_a plugin              | test_decoding slot_type           | logical datoid              | 13325 database            | postgres active              | f active_pid          | xmin                | catalog_xmin        | 515517 restart_lsn         | 1/D8000028 confirmed_flush_lsn | 1/E6000060 pg_xlog is now 593M with 36 wal files: $ du  -sh pg_xlog 593M    pg_xlog $ ls -1 pg_xlog/; ls -1 pg_xlog/0* | wc -l 0000000100000001000000CA 0000000100000001000000CB 0000000100000001000000CC 0000000100000001000000CD 0000000100000001000000CE 0000000100000001000000CF 0000000100000001000000D0 ... 0000000100000001000000E9 0000000100000001000000EA 0000000100000001000000EB 0000000100000001000000EC 0000000100000001000000ED archive_status 36 I don't see any reason for it to keep these files around. Archivig is working, it's only 1 - 2 files behind: $ ls -1 ../wal 0000000100000001000000BD 0000000100000001000000BE 0000000100000001000000BF 0000000100000001000000C0 0000000100000001000000C1 ... 0000000100000001000000E6 0000000100000001000000E7 0000000100000001000000E8 0000000100000001000000E9 0000000100000001000000EA 0000000100000001000000EB How do I get the cluster to begin removing old wal files? Thanks in advance