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 1h9XLI-0006Fp-Jt for pgsql-general@arkaria.postgresql.org; Thu, 28 Mar 2019 15:53:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9XLH-0005cx-El for pgsql-general@arkaria.postgresql.org; Thu, 28 Mar 2019 15:53:23 +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 1h9XLG-0005co-Us for pgsql-general@lists.postgresql.org; Thu, 28 Mar 2019 15:53:23 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9XLE-0004AL-D0 for pgsql-general@postgresql.org; Thu, 28 Mar 2019 15:53:21 +0000 Received: by mail-pl1-x644.google.com with SMTP id k2so5151130plt.3 for ; Thu, 28 Mar 2019 08:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=EDvjBO3sZ5ELAsTCPsLPjA2vQfEA7Lyw/79USFhsbbo=; b=t8iJf/4z6Zj+LIocn+GF3fG30IPiBR1cLpJI3r7FdNFIHQNISCft1MNjw/NLv8k301 lvaazxdXJ8COfcwj26WTJjn+oGJZnKgVfN0BCUt08+CmCvqOEmkXQYA7n0hVhnqDtxat t6J+GrYLfKnbbJCX9a5Sg8fqb3TWtDUCdRdMJkrLiVjSxtENS+ViG2CvvhPDQ9mnsLGI viT0dd5OHUJ5zpcaARcObE8Vjz+F0OVHU2qE0V2dsgcMuvMIbZ+MclMis0l5ueVhT2l9 euq0q2ECRj774ZNUQ4HmCoeDEuB28kPIuLOpdtg6oYndCttTOEhpeXfyzLq+vG39OjdJ Z54Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=EDvjBO3sZ5ELAsTCPsLPjA2vQfEA7Lyw/79USFhsbbo=; b=R7dCKGy1Tg1lVwWJY/qt93fPNd469ZxA3DFYoN3mDoUtWwvGJTH8EPxLXmDKOIJ5x3 qzkHQ0k1/sF0pk4CeTe3l8L4soT5LrwAWd7/AGrPBiBWpeBQ+B+2kGB4blSC/RhrCKmk zGW7f3ujnAsJDWgSecAF7GtFIa6/huDguaNFuO2/dg18sALZZQWHzymR0yhKoWZG3QQk vW7cZIQrN7KdXb0Kcv6RIz6CrOZDhI571f/nukzg41OLretp+0EIaIcuKnlDi0YhHL7C Y49WD8LNKBbKDcKBvz6rea0vQdky9svxeEm4we8J6+MbO5AliOG/Zg9UW33SZ6rqvORH f5tw== X-Gm-Message-State: APjAAAUGHMNZ/py1gEYOsvoQJODibt+kYfPMeZYm2/MuCt7bfulFmKfL 5KeDQ0neiN0zc89ri4mwuQCeYNDc X-Google-Smtp-Source: APXvYqwAUvCIIRIAvJWVNNbz+nNhQiM4oVtkZbdQ/JL18CqgwzgTbNPXxo+ng7EmojazBLhUgO8sSQ== X-Received: by 2002:a17:902:f08a:: with SMTP id go10mr30252041plb.121.1553788398872; Thu, 28 Mar 2019 08:53:18 -0700 (PDT) Received: from [10.104.134.14] ([155.100.47.6]) by smtp.gmail.com with ESMTPSA id n65sm88875385pfb.160.2019.03.28.08.53.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 08:53:18 -0700 (PDT) Subject: Re: stale WAL files? To: Michael Paquier Cc: Adrian Klaver , "pgsql-general@postgresql.org" References: <10FF70E2-9F70-4469-A4F4-4081988F0204@gmail.com> <3dccbbe4-e115-11ab-2d78-74c3cc9e2e43@aklaver.com> <599C6022-1DA1-477D-895C-7E217D350B85@gmail.com> <20190328133005.GB2558@paquier.xyz> From: Rob Sargent Message-ID: <973f0fdf-e20f-a8a1-86c8-7f145eb31b70@gmail.com> Date: Thu, 28 Mar 2019 09:53:16 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190328133005.GB2558@paquier.xyz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/28/19 7:30 AM, Michael Paquier wrote: > On Tue, Mar 26, 2019 at 09:50:37AM -0600, Rob Sargent wrote: >> No, sorry I should have said that up front. We’re simple folk. > What is the WAL position (LSN) postgres=# select * from pg_current_wal_flush_lsn();  pg_current_wal_flush_lsn --------------------------  CEA/E57EAA8 (1 row) postgres=# select * from pg_current_wal_insert_lsn();  pg_current_wal_insert_lsn ---------------------------  CEA/E57EAA8 (1 row) postgres=# select * from pg_current_wal_lsn();  pg_current_wal_lsn --------------------  CEA/E57EAA8 (1 row) > where Postgres is writing to and what > is the set of WAL segments in pg_wal (or pg_xlog if that's a server > older than 10)?  select version(); version ---------------------------------------------------------------------------------------------------------  PostgreSQL 10.7 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit (1 row) This is pg10 so it's pg_wal.  ls -ltr -rw-------. 1 postgres postgres 16777216 Mar 16 16:33 0000000100000CEA000000B1 -rw-------. 1 postgres postgres 16777216 Mar 16 16:33 0000000100000CEA000000B2  ... 217 more on through to ... -rw-------. 1 postgres postgres 16777216 Mar 16 17:01 0000000100000CEA000000E8 -rw-------. 1 postgres postgres 16777216 Mar 16 17:01 0000000100000CEA000000E9 -rw-------. 1 postgres postgres 16777216 Mar 28 09:46 0000000100000CEA0000000E > Please double-check the configuration value of > wal_keep_segments, #wal_keep_segments = 0          # in logfile segments, 16MB each > and as mentioned upthread, could you make sure that > you have no replication slots active? This could be part of the problem? #max_replication_slots = 10     # max number of replication slots but   select * from pg_replication_slots;  slot_name | plugin | slot_type | datoid | database | temporary | active | active_pid | xmin | catalog_xmin | restart_lsn | confirmed_flush_lsn -----------+--------+-----------+--------+----------+-----------+--------+------------+------+--------------+-------------+--------------------- (0 rows) > This can be done simply by > querying pg_replication_slots. Please note as well that checkpoints > are server-wide, so there is no point to run them on all databases. > Only one command will be effective for all databases. I suspected as much, but there weren't many dbs so I went all in. > -- > Michael