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 1gyzGw-0008Rs-Qp for pgsql-admin@arkaria.postgresql.org; Wed, 27 Feb 2019 13:29:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gyzGv-0006O5-59 for pgsql-admin@arkaria.postgresql.org; Wed, 27 Feb 2019 13:29:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gyzGu-0006Ny-RG for pgsql-admin@lists.postgresql.org; Wed, 27 Feb 2019 13:29:16 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gyzGs-0000xi-Da for pgsql-admin@lists.postgresql.org; Wed, 27 Feb 2019 13:29:16 +0000 Received: by mail-qt1-x844.google.com with SMTP id u7so9903659qtg.9 for ; Wed, 27 Feb 2019 05:29:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Hr0h/Z7tdqecxdMuFzmHTA9OW/XpjVButhGI5ui3ifM=; b=cSZlNt3RkcPGkD1TYFErvth/57gGq2GdOGuiscpjFbpqDL32MVDtDKHOff8vUAybbk Bk0INwDe9lQTo3Z1qzsqsaI2jHudV4uJxZbEm8ZNp/PNx3wvJX0QJTdv0CZVtEQNtt32 Mvakv5ZB/5RHdbD3WolDPcmNMYogj0pECHUbeCZBdh9Cjwjz+deocC8+Zk62ghBt0E8A hn4scO3ib9RcwPvEtoZf0sKTT8qfVOeYu8+XQaO/0IBuyVxB5SjbUxlLuN+0nw9Cmgnh ukJiHgKLxyuJ5i98Q3GLTjM5YfEaDPK44tuQ6zzuwTuJ4Sz4kshQ9a8akj4cYf4FxkP8 dSvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Hr0h/Z7tdqecxdMuFzmHTA9OW/XpjVButhGI5ui3ifM=; b=ghuRKpiYtNefBSrzrrihXYuKBAkm2Nh9TFUZap03M3f/xdKemkO5kR67mbclpZmRXW UnVIS1KzYiMnOyAiRg9kxoRitFn9LsbloKLHHNJQ4iiAaH3uHW193hZ3HZv1GvhUkZoy 2kiuhxaU64/BqGQChHLEPBp1TVjDr9KoQtXbdl+k/9vGfE2j0dHYcyQkBb88G7PVJ5Sq TOO66Yznd4DE/Rio1e/Anj/eeTZIZkblokpk8dgiIPH8PH6JyJVD0LJjQaHuAwpwJGVS eKfA7lXigvvkpCbC7SxmK1Hab2CHexPvC32QgYcVyeHBwvbBX8Y5eOVYUEyo85hxDJKy XyxQ== X-Gm-Message-State: APjAAAUXIVD01PZ34+QdnP1gsX5rJz64puI41YoOXkbLn+gjtR6SnUvH CjlpKMPksRA3lWcXJuejrh5U93my X-Google-Smtp-Source: APXvYqyUj6+7nLmGo6nVuwFJUaAK/2eJnwR8rDEyGgx+2Ln1S/Xr7wYe6pDHsTGWstmBJ6u9fOjGsg== X-Received: by 2002:a0c:e7cc:: with SMTP id c12mr1826974qvo.169.1551274150992; Wed, 27 Feb 2019 05:29:10 -0800 (PST) Received: from ?IPv6:2600:1003:b001:b748:6c7e:1517:31e0:8653? ([2600:1003:b001:b748:6c7e:1517:31e0:8653]) by smtp.gmail.com with ESMTPSA id x80sm13243057qkx.85.2019.02.27.05.29.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 05:29:10 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: Logical replication and wal segment retention From: John Scalia X-Mailer: iPhone Mail (16D57) In-Reply-To: <59567e0a-78e4-ed1c-f5b1-033aafcfb68a@matrix.gatewaynet.com> Date: Wed, 27 Feb 2019 08:29:09 -0500 Cc: pgsql-admin@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <75D08FE7-36EC-4721-9382-DF8AF508644D@gmail.com> References: <695C083D-AFB5-431B-B022-ED442CE94794@gmail.com> <20190227125242.6ixy4jkzcuj55cdl@vault.lan> <59567e0a-78e4-ed1c-f5b1-033aafcfb68a@matrix.gatewaynet.com> To: Achilleas Mantzios List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I thought as much. The basic problem, however, is that I never created the l= ogical slots. The IIDR application did that all by itself, and after it term= inated, it did not bother to remove the slots. So, my disk monitor threw up w= hen the WAL file system began to fill up. I was trying then to figure out wh= y it did that. Sent from my iPhone > On Feb 27, 2019, at 7:57 AM, Achilleas Mantzios wrote: >=20 >> On 27/2/19 2:52 =CE=BC.=CE=BC., Johannes Truschnigg wrote: >> Hi Jay, >>=20 >>> On Wed, Feb 27, 2019 at 07:40:26AM -0500, John Scalia wrote: >>> Hello, folks, >>>=20 >>> Yesterday, I had a small file system fill up, due to some logical >>> replication testing we had been performing. We had been testing IBM=E2=80= =99s IIDR >>> system and apparently it had built a logical replication slot on my serv= er. >>> When the test was completed, nobody removed the slot, so WAL segments >>> stopped being dropped. Now I can understand the difficulty separating wh= at >>> physical versus logical replication needs from the WAL segments, but as >>> logical replication is database specific not cluster wide, this behavior= was >>> a little unexpected, since the WAL segments are cluster wide. Are WAL >>> segments going to pile up whenever something drops a logical replication= >>> connection? I=E2=80=99ve seen it, but it seems like this could be a bad t= hing. >> Since Logical Replication is piggybacked on Physical Replication, you can= not >> use the first without having the latter. And yes, what you experienced is= one >> of the dangers of using replication slots when having a busy database (i.= e. >> producing lots of WAL) and a filesystem with little excess space. Under t= hese >> circumstances, it is imperative to monitor for (and alert on) anything go= ing >> awry with your replication slot consumers, and/or the size of your wal/xl= og >> directory. It's a feature of replication slots to work that way - but one= that >> may end up biting you. > A logical approach for replication slots would be to accept a parameter re= garding max WAL files to retain, after which newer WALs will be removed and t= he primary server saved. Pretty much like : --archive-push-queue-max argume= nt of pgbackrest . >>=20 >=20 >=20 > --=20 > Achilleas Mantzios > IT DEV Lead > IT DEPT > Dynacom Tankers Mgmt >=20 >=20