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 1gpFLC-0004gx-DM for pgsql-admin@arkaria.postgresql.org; Thu, 31 Jan 2019 16:37:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gpFLA-00060p-Op for pgsql-admin@arkaria.postgresql.org; Thu, 31 Jan 2019 16:37:24 +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 1gpFLA-0005zp-B7 for pgsql-admin@lists.postgresql.org; Thu, 31 Jan 2019 16:37:24 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpFL7-0003N9-Nz for pgsql-admin@lists.postgresql.org; Thu, 31 Jan 2019 16:37:23 +0000 Received: by mail-qt1-x843.google.com with SMTP id t33so4145990qtt.4 for ; Thu, 31 Jan 2019 08:37:21 -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=WUG0f/PmyXvC1rhIszyEV0ztazvJd2wu4KOwcpjgyPc=; b=My7PQpHkneLee6IZf9kuMESOEmkEKrA0/inBaVAX677lDXn5Ci1jubIJ++XQes38ja ZBmuLlUv/K5Yq7YoiteulqRQnDDn0fzg8c7JtyZfui2DZR0rVRY7X79AGJbDhsScoVtN iqyOlisctn6i6WNdpr+uhb+tx2ZrOA4fEUECBc+3Q8t2U9JkfQhC0cnSy+bM41OHN4u/ p56V3WjB8u7MPX1jZlZKGO1NWTBrAgJLoK+Rqz5CRSJJM+LmaBPCcCGAGS3unrQMfckv 0j3xnTJsTjIoy7AFErOd/zf7YZ4fXCS6ChqztCU3iifshjx14tILP5A9RTxwNstqxgc0 Rwpg== 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=WUG0f/PmyXvC1rhIszyEV0ztazvJd2wu4KOwcpjgyPc=; b=IdrwwKJ/VDVOC7VcuTlKyhvXoAR0eBkZUedEAtcXRQN1VcXny9LkNoSn8st7k+STlI yRLxCn0AFWR/YX1q9LltN7uOlWoBjRNil9ETZcOayXYDCuMWGRMh2+jbaTB3Rt6MnUpl PFbwm2jFziLhp2lMv28uD0DG5/oPXsaQpeDpaPdXa8B6NrzmuXAIsrF72WdOPi4zCULs lf05TgOLH21SU7z4OJemvM7QChR4pfJZdxU/oFvZ7F2OtIl+MQauA3EudAWbudxn1pJ8 N8vUpcJUd6bzp2vXlUJiGjqvdFGz7yS4N6RiaRZuoLdg5mpbB3zGIZrAAksn2e8VdM1F SucQ== X-Gm-Message-State: AJcUukddOXukPWw0vVxpMaGqgYtysodOHqW6hdi4CR1q6OoneQ5H25Ar MD+xx8SDPtBBpBtx91bxyLMgF8/L X-Google-Smtp-Source: ALg8bN40zVWKt46tRGJE+lhGzMF6IW6PDMKRIP0h44+ssqMw+/3e53vpeE+PZRr4WePN6YWfSbkS/Q== X-Received: by 2002:a0c:d268:: with SMTP id o37mr33433326qvh.136.1548952640865; Thu, 31 Jan 2019 08:37:20 -0800 (PST) Received: from ?IPv6:2600:1003:b02a:fc5a:b546:c074:d24a:e71c? ([2600:1003:b02a:fc5a:b546:c074:d24a:e71c]) by smtp.gmail.com with ESMTPSA id g189sm4841190qkb.3.2019.01.31.08.37.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jan 2019 08:37:20 -0800 (PST) Content-Type: multipart/alternative; boundary=Apple-Mail-0A92266D-4EAF-4F38-8E91-3B874C447572 Mime-Version: 1.0 (1.0) Subject: Re: Old WAL files under pg_xlog not getting delete From: John Scalia X-Mailer: iPhone Mail (16B92) In-Reply-To: Date: Thu, 31 Jan 2019 11:37:19 -0500 Cc: Ron , Pgsql-admin Content-Transfer-Encoding: 7bit Message-Id: References: <201901310000.fkapsf6clz5s@alvherre.pgsql> To: rammohan ganapavarapu List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail-0A92266D-4EAF-4F38-8E91-3B874C447572 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ram, Remember that keep_wal_segments is a minimum setting, not a maximum one. It=E2= =80=99s telling the database to maintain at least that many segments. Plus, c= heck how you=E2=80=99ve set the archive_command. If that=E2=80=99s not corre= ct, nothing will remove the WAL files. =E2=80=94 Jay Sent from my iPhone > On Jan 31, 2019, at 11:22 AM, rammohan ganapavarapu wrote: >=20 > Ron, >=20 > I have changed the wal_keep_segments=3D100 and restarted the postgresql pr= ocesses but i still see 500+ files under pg_xlog, i had to run checkpoint ma= nually to clean. >=20 > Ram >=20 >> On Wed, Jan 30, 2019 at 7:19 PM Ron wrote: >>> On 1/30/19 9:09 PM, rammohan ganapavarapu wrote: >>> Thank you all, but irrespective of count i have why is it keeping old fi= les? >>=20 >> Because you're telling it to!! >>=20 >> max_wal_size=3D 1GB >> wal_keep_segments=3D500 >>=20 >>> and how is it using those files? Is there any processes that can flush o= r remove those files? >>=20 >> Change the parameter and restart the server... >>=20 >>>=20 >>>> On Wed, Jan 30, 2019, 4:11 PM David G. Johnston >>> On Wed, Jan 30, 2019 at 5:00 PM Alvaro Herrera wrote: >>>> > Hmm ... I would recommend to keep the xlog files in a subdir, not the= >>>> > root of the filesystem. >>>>=20 >>>> They are in a subdir (under /opt/pgdata), and the OP seems likely to >>>> have omitted the self/parent hidden directories during his check as >>>> well. Plus per the docs we actually expect 501 so there isn't a need >>>> to account for 6 extra, just 5. >>>>=20 >>>> Dave >>>>=20 >>=20 >> --=20 >> Angular momentum makes the world go 'round. --Apple-Mail-0A92266D-4EAF-4F38-8E91-3B874C447572 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ram,

Remember that keep_= wal_segments is a minimum setting, not a maximum one. It=E2=80=99s telling t= he database to maintain at least that many segments. Plus, check how you=E2=80= =99ve set the archive_command. If that=E2=80=99s not correct, nothing will r= emove the WAL files.
=E2=80=94
Jay

Sent from my iPhone

O= n Jan 31, 2019, at 11:22 AM, rammohan ganapavarapu <rammohanganap@gmail.com> wrote:

Ron,

I have changed the wal_keep_segments=3D100 and restarted the postgresq= l processes but i still see 500+ files under pg_xlog, i had to run checkpoin= t manually to clean.

Ram

On Wed, Jan 30, 2019 at 7:19 PM Ron <ronljohnsonjr@gmail.com> wrote:=
=20 =20 =20
On 1/30/19 9:09 PM, rammohan ganapavarapu wrote:
=20
Thank you all, but irrespective of count i have why is it keeping old files?

Because you're telling it to!!

max_wal_size=3D 1GB
wal_keep_segments=3D500

and how is it using those files? Is there any processes that can flush or remove those files?

Change the parameter and restart the server...


On Wed, Jan 30, 2019, 4:11 PM David G. Johnston <david.g.johnston@gmail.com wrote:
On Wed, Jan 30, 2019 at 5:00 PM Alvaro Herrera <alvherre@2ndquadrant.c= om> wrote:
> Hmm ... I would recommend to keep the xlog files in a subdir, not the
> root of the filesystem.

They are in a subdir (under /opt/pgdata), and the OP seems likely to
have omitted the self/parent hidden directories during his check as
well.  Plus per the docs we actually expect 501 so there isn'= t a need
to account for 6 extra, just 5.

Dave


--
Angular momentum makes the world go 'round.
= --Apple-Mail-0A92266D-4EAF-4F38-8E91-3B874C447572--