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 1gpFjW-0005sF-PP for pgsql-admin@arkaria.postgresql.org; Thu, 31 Jan 2019 17:02:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gpFjV-0005es-F9 for pgsql-admin@arkaria.postgresql.org; Thu, 31 Jan 2019 17:02:33 +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 1gpFjV-0005ea-2f for pgsql-admin@lists.postgresql.org; Thu, 31 Jan 2019 17:02:33 +0000 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpFjN-0003wr-UP for pgsql-admin@lists.postgresql.org; Thu, 31 Jan 2019 17:02:31 +0000 Received: by mail-ot1-x341.google.com with SMTP id g16so3383103otg.11 for ; Thu, 31 Jan 2019 09:02:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=lZu1E4wnDp89WDzof02YOTsBR9DtRaAU7Tp3pQ7TquM=; b=Y3e/vi9PWxsARlNzbo9BoOrQJJNRQw+omaAKkRdz7lbbTCyjzPS3SCbat55IWZo72b m8exLV9VjXEq71wN3cyweW5mmoT6S0PlBCrCAAdIs3dbFnAG2IVmUID6qkW0geTwL3NF yq71PdH7y9tdeBQsPOYognfggK/gEsyZCLnkRu6R+dbb/dtNp7EMEOg4tnKfX5Ofaa14 yBqboSmj/HRhynHg1Z5Enf+CtgMG6sJknMZuOmk+CeJvRjZIKwllvla4/a3zOdU+WlzE eP4CmTlc1eHz4jS6k5Z8OI8CiJXfZintbVk6JXvSHWUmB7t/U3FyYDtahG2/LxpzGsxv KBwA== 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; bh=lZu1E4wnDp89WDzof02YOTsBR9DtRaAU7Tp3pQ7TquM=; b=rj3ue2QaavJyxrEepKZAf+cY+1Qn6fxUDDSF/v6Wj3AvcMKCpoWS++Fst1cZQeFCch nfGcRBDbKNBcoVyRyA96DbR+2HTZUiLIf7StzT0NjTxLyHgorUbwRDEGlGvZEBNL17wS mcSL29Tu4I5L7Pc759YIEISNpH0OzedVrT1VQivMrSDeKMfFvZGgDxH72Y6MThpq2Mga 2NTaHLhJ76gluLrK/0AJ2k/RQjPRPDTPuTkDt12qp/CHEqyeDPiubDeULDe3EklPyU3+ GelxNFIoZcPpMt/bSXkdn7dgHuwSP7DRoTQUdXQ1o/GKkXtcPP536mcFfac26g3AsPe4 leeA== X-Gm-Message-State: AJcUukcac29LR+jKEZqbr6tqgh6CAaU0S1LO2X9NKofvXQ7q3bM0gzYR hP47vMhZEGdpeaR5aEqd2HX0uUk0 X-Google-Smtp-Source: ALg8bN454pWFpoUgRRTv+WGEs2/KOyvvd1vlLTK3+CYRKVH/64sDbau4T81iSVElW/IrY8/JJOeLVA== X-Received: by 2002:a9d:7a8c:: with SMTP id l12mr26700610otn.335.1548954145038; Thu, 31 Jan 2019 09:02:25 -0800 (PST) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id h25sm2078832otj.27.2019.01.31.09.02.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jan 2019 09:02:23 -0800 (PST) Subject: Re: Old WAL files under pg_xlog not getting delete To: Pgsql-admin References: <201901310000.fkapsf6clz5s@alvherre.pgsql> From: Ron Message-ID: Date: Thu, 31 Jan 2019 11:02:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------13953DDEC8C4D931BC21263B" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------13953DDEC8C4D931BC21263B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit "i had to run checkpoint manually to clean." I see no problem with that.  Postgres would have checkpointed sooner or later. On 1/31/19 10:22 AM, rammohan ganapavarapu wrote: > Ron, > > I have changed the wal_keep_segments=100 and restarted the postgresql > processes but i still see 500+ files under pg_xlog, i had to run > checkpoint manually to clean. > > Ram > > 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 >> files? > > Because you're telling it to!! > > max_wal_size= 1GB > wal_keep_segments=500 > >> 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 >> wrote: >> >> 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. >> >> 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. --------------13953DDEC8C4D931BC21263B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit "i had to run checkpoint manually to clean."

I see no problem with that.  Postgres would have checkpointed sooner or later.

On 1/31/19 10:22 AM, rammohan ganapavarapu wrote:
Ron,

I have changed the wal_keep_segments=100 and restarted the postgresql processes but i still see 500+ files under pg_xlog, i had to run checkpoint manually to clean.

Ram

On Wed, Jan 30, 2019 at 7:19 PM Ron <ronljohnsonjr@gmail.com> 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 files?

Because you're telling it to!!

max_wal_size= 1GB
wal_keep_segments=500

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.com> 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.
--------------13953DDEC8C4D931BC21263B--