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 1objom-00027e-Kn for pgsql-general@arkaria.postgresql.org; Fri, 23 Sep 2022 14:38:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1objok-0005Ox-1z for pgsql-general@arkaria.postgresql.org; Fri, 23 Sep 2022 14:38:14 +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 1objoj-0005Oo-MC for pgsql-general@lists.postgresql.org; Fri, 23 Sep 2022 14:38:13 +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 1objoh-0005qR-7w for pgsql-general@postgresql.org; Fri, 23 Sep 2022 14:38:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=Content-Type:MIME-Version: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: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=S+Fd4jAlcTNYG2A0Et7Msh1GWAhEFCO1qhWFHQpbYSE=; b=Ztp+LMfXPC9LxP74+naOlS4L4C SLr4Mg9Sru04DahrSjccxb6G6Awn0/7odj8pTmyf9CGUTA7yZfT38dbJ30/2yi1edH3V5DNoJt/bx nX/l3+XaE0t2yqub1qX+8y2Mp6watekCvgPn9c/noeCAfkrpctaON3Ba84po3+0OBRig=; Received: from depesz by depesz.com with local (Exim 4.94.2) (envelope-from ) id 1objof-006oWK-5Q for pgsql-general@postgresql.org; Fri, 23 Sep 2022 16:38:09 +0200 Date: Fri, 23 Sep 2022 16:38:09 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: pgsql-general mailing list Subject: How to handle logical replication 12->14, when our max_replication_slots gets overrun by inactive sync workers Message-ID: Reply-To: depesz@depesz.com MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, I reported a bug aobut it earlier, and from what I know it has been fixed, but new release will come later. For now I have this situation: 1. max_replication_slots is 50 2. database to replicate has 67 schemas, and ~ 26k tables. 3. schemas are split into 5 slots 4. pg14 side has max_sync_workers_per_subscription = 2 we start replication. within an hour all 50 replication slots on pg12 are used. 5 by our pg14 upgrade slots, and the other *45* by sync workers, which are generally active = false. at this moment all sync traffic dies (seen in network traffic data). we tried to kill inactive sync workers - didn't help. I tried to set max_sync_workers_per_subscription = 0, to avoid using these extra workers, but it just seems to make slots sit there. 1 table in each slot changed status to 'r', but all other are at 'i'. Currently I'm running a test where all tables are in single slot, with 2 max_sync_workers_per_subscription but it will take "a while" to get it to working state. Is there anything we can do now? I seem to have a case where the problem is 100% repeatable, so if anyone has ideas I can test them fully. Best regards, depesz