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 1i0G8h-0004hs-3y for pgsql-general@arkaria.postgresql.org; Wed, 21 Aug 2019 02:14: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 1i0G8f-0001HO-MA for pgsql-general@arkaria.postgresql.org; Wed, 21 Aug 2019 02:14: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 1i0G8f-0001HG-CJ for pgsql-general@lists.postgresql.org; Wed, 21 Aug 2019 02:14:17 +0000 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i0G8c-0002t3-4K for pgsql-general@lists.postgresql.org; Wed, 21 Aug 2019 02:14:16 +0000 Received: by mail-qt1-x82e.google.com with SMTP id l9so1203665qtu.6 for ; Tue, 20 Aug 2019 19:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=sxOHdbWLqyvYOmI5XFITGc9EdOI/7qBO9E0DF2AuJjM=; b=OTVy6/f/FD8+bitdrj/E6zqh+sDVHZOybC2peasLP2yJ4ABvUqyLOJtGy+PLtEEVMn adbfAAAlSfGuhngFevRMNf+I1ecjRlizNilN4YjHmm2xu0XWbCVWlFvNYNJoYZSfhpUQ 82WzCQCHaofRXDuKFptxAiagfYS4af8OsDT2bSucUzR3SH+gR219ldkjIZm8P324TN5c MRtFEymy7X0nnv8rihV7X8O/jrP31VRFkcTDvG0z2tP64ox47X5q+B0O7q0vGa2SWSCm xaoQc6r3ujDrYPFmtPjzM0ZYuJ2p8MPimfIgGYU5OQl79J8mWJ5XMVFIgIeoF1PuNj00 QEfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sxOHdbWLqyvYOmI5XFITGc9EdOI/7qBO9E0DF2AuJjM=; b=M9hXiniDLzkz/bg1BJXYQhZMmaqZG/aK0AAq7hMgs4MqOQMM9t0bEipbL6m89XsZlH QXdxdLFVcnZ5J2dVQDO86pyBReLQEYabuXNNEnnBtFqMDs6f1DexeXauOetMGjr7K7Y9 lIjzjN3pqQjUTUDm2IRrmz0Ix3LIcWpPS33k/qs80WWjsamkAZGOqD6oyW61SgO4+FTQ 5UPcRgUVW38sT/bA+47iRk9C0628+Zj4ZEpWHNnEuUxu1cH2MGtnkYiyhI8FlNJKU6+b IxDRQS64alo1a314cxTg0P/l0nMau+snelnJt4X1PI9VyCfYjIWPS8DM7QoOihqD1ivr KIug== X-Gm-Message-State: APjAAAVb/uIHqe/VeiStFvdke0dwLwLCM+oq8649ehWFXXpWX/w1KpnS qLatsvdNn1Ei14UHHQK9LeF2rBT5IF6hYVr8iYs6SDMq2qxz0ZgXF2FyCRXRvfQJVsI0XgDdADi VYLQZdpRN85QUHcWZd5A8J7FWEQI7ZcojxFs2SZBhiiIr9a8BEezO2ikZ0GQS1v6PCUFwFxzDFH YzstYIp7NLRs6AwE1/L44I X-Google-Smtp-Source: APXvYqwPUYuHdR8+Onc0oXg+aSarAGtaTfx9yixAums9YWcsMm9qOiUN1M9rU5Xh8AbfbVdBlWwqmQ== X-Received: by 2002:a65:4b8b:: with SMTP id t11mr27126852pgq.130.1566351816680; Tue, 20 Aug 2019 18:43:36 -0700 (PDT) Received: from osaka.octopusnet (p8584121-ipngn39001marunouchi.tokyo.ocn.ne.jp. [180.39.36.121]) by smtp.gmail.com with ESMTPSA id h195sm32357235pfe.20.2019.08.20.18.43.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Aug 2019 18:43:36 -0700 (PDT) Subject: Re: pg_xlog on slaves has grown to 200GB To: Vikas Sharma , pgsql-general@lists.postgresql.org References: From: Ian Barwick Message-ID: Date: Wed, 21 Aug 2019 10:43:33 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 8/20/19 11:17 PM, Vikas Sharma wrote:> Hello, > We are using postgresql 9.5 with repmgr 3.3.2 in streaming replication setup > with 1 master and 2 slaves. I have noticed that the pg_xlog on slaves has > grown to 200GB and is still growing. > > Please advise why pg_xlog is growing and not pruning itself, is there any > parameter I need to setup to accomplish this? or repmgr will control it > itself. This is not something which repmgr is designed to do. Current repmgr versions do however provide options to check node status for potential issues, e.g.: $ repmgr node check --slots CRITICAL (1 of 1 physical replication slots are inactive) $ repmgr node check --archive-ready WARNING (63 pending archive ready files (threshold: 16)) Note you are using version 3.3.2, which was released over two years ago and which is no longer supported; I strongly recommend upgrading to the latest version (4.4). > I am not 100% sure but feel it pg_xlog never used to grow this much or was > clearing itself, I can see there are WALs since May 2019 but not before > that. I want to understand why the WALs started accumulating since then. we > have this setup since more than a year. As Stephen Frost mentioned his response, the most likely issues are: - an inactive replication slot (check with "SELECT * FROM pg_replication_slots WHERE active IS FALSE") - some sort of WAL archiving failure ("SELECT * FROM pg_stat_archiver" will show if issues are being encountered and the PostgreSQL log file will show specifics of any issues) Regards Ian Barwick -- Ian Barwick https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services