Re: Temporary WAL segments files not cleaned up after an instance crash

2018-07-13 Thread Yugo Nagata
On Thu, 12 Jul 2018 16:44:45 +0900 Michael Paquier wrote: > On Thu, Jul 12, 2018 at 03:35:53PM +0900, Yugo Nagata wrote: > > I think it makes sense to remove unnecessary temporary WAL files although > > I'm not sure how high the risk of ENOSPC is. > > It depends on how close to the partition siz

Re: Temporary WAL segments files not cleaned up after an instance crash

2018-07-12 Thread Michael Paquier
On Thu, Jul 12, 2018 at 03:40:43PM +0300, Heikki Linnakangas wrote: > Sure. Thanks for the reviews, I have pushed the patch after moving the elog() call and changing the logs to mention "WAL segments" instead of "WAL files". -- Michael signature.asc Description: PGP signature

Re: Temporary WAL segments files not cleaned up after an instance crash

2018-07-12 Thread Heikki Linnakangas
On 12/07/18 15:38, Michael Paquier wrote: On Thu, Jul 12, 2018 at 01:15:03PM +0300, Heikki Linnakangas wrote: On 12/07/18 10:44, Michael Paquier wrote: + snprintf(path, MAXPGPATH, XLOGDIR "/%s", xlde->d_name); + elog(DEBUG2, "removed temporary WAL file \"%s\"", path)

Re: Temporary WAL segments files not cleaned up after an instance crash

2018-07-12 Thread Michael Paquier
On Thu, Jul 12, 2018 at 01:15:03PM +0300, Heikki Linnakangas wrote: > On 12/07/18 10:44, Michael Paquier wrote: > > + snprintf(path, MAXPGPATH, XLOGDIR "/%s", xlde->d_name); > > + elog(DEBUG2, "removed temporary WAL file \"%s\"", path); > > + unlink(path); > > The elo

Re: Temporary WAL segments files not cleaned up after an instance crash

2018-07-12 Thread Heikki Linnakangas
On 12/07/18 10:44, Michael Paquier wrote: On Thu, Jul 12, 2018 at 03:35:53PM +0900, Yugo Nagata wrote: One little thing I noticed is the function name "RemoveXLogTempFiles". Other similar functions are named as RemoveOldXlogFiles or RemoveXlogFile (using Xlog not XLog), so it seem to me more con

Re: Temporary WAL segments files not cleaned up after an instance crash

2018-07-12 Thread Michael Paquier
On Thu, Jul 12, 2018 at 03:35:53PM +0900, Yugo Nagata wrote: > I think it makes sense to remove unnecessary temporary WAL files although > I'm not sure how high the risk of ENOSPC is. It depends on how close to the partition size limit max_wal_size is set, and how much a system is unstable. Switc

Re: Temporary WAL segments files not cleaned up after an instance crash

2018-07-11 Thread Yugo Nagata
On Mon, 14 May 2018 14:49:55 +0900 Michael Paquier wrote: > Hi all, > > While playing with a standby as follows I noticed that xlogtemp.* > generated in pg_wal may stay around when entering crash recovery. The > test I was conducting is pretty simple: > - Use a primary and a standby. > - Run pg

Temporary WAL segments files not cleaned up after an instance crash

2018-05-13 Thread Michael Paquier
Hi all, While playing with a standby as follows I noticed that xlogtemp.* generated in pg_wal may stay around when entering crash recovery. The test I was conducting is pretty simple: - Use a primary and a standby. - Run pgbench on the primary. - Then restart the standby with -m immediate and for