Begginers question

Started by Alex Samadover 8 years ago6 messagesgeneral
Jump to latest
#1Alex Samad
alex@samad.com.au

Hi

So I have been playing with an streaming cluster. I have the replication
working I believe.

But whilst attempting to do an import of my original DB, I filled up my
disk pg_xlog directory.

Strangley I have tried this before and not filled this up.

so
1) why did it fill up this time and not previously
I add this
archive_command = '/bin/true'
wal_keep_segments = 1000 # <<< I'm guessing its this

2) how do I fix up, can I just remove the files from the pg_xlog directory

A

#2Michael Paquier
michael@paquier.xyz
In reply to: Alex Samad (#1)
Re: Begginers question

On Wed, Aug 16, 2017 at 2:32 PM, Alex Samad <alex@samad.com.au> wrote:

1) why did it fill up this time and not previously
I add this
archive_command = '/bin/true'
wal_keep_segments = 1000 # <<< I'm guessing its this

2) how do I fix up, can I just remove the files from the pg_xlog directory

Don't do that. those files are managed by Postgres so you may finish
with a corrupted cluster. Instead you should lower the value of
wal_keep_segments, reload the server parameters, and then enforce two
checkpoints to force WAL segments to be recycled. Note that this
depends also on the values of checkpoint_segments
(max_wal_size/min_wal_size in Postgres 9.5 and onwards).
--
Michael

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Alex Samad
alex@samad.com.au
In reply to: Michael Paquier (#2)
Re: Begginers question

On 16 August 2017 at 16:16, Michael Paquier <michael.paquier@gmail.com>
wrote:

On Wed, Aug 16, 2017 at 2:32 PM, Alex Samad <alex@samad.com.au> wrote:

1) why did it fill up this time and not previously
I add this
archive_command = '/bin/true'
wal_keep_segments = 1000 # <<< I'm guessing its this

2) how do I fix up, can I just remove the files from the pg_xlog

directory

Don't do that. those files are managed by Postgres so you may finish
with a corrupted cluster. Instead you should lower the value of

Too late, its okay its a learning experience.

wal_keep_segments, reload the server parameters, and then enforce two
checkpoints to force WAL segments to be recycled. Note that this

how do I force check points

depends also on the values of checkpoint_segments
(max_wal_size/min_wal_size in Postgres 9.5 and onwards).
--
Michael

thanks

#4Achilleas Mantzios
achill@matrix.gatewaynet.com
In reply to: Alex Samad (#3)
Re: Begginers question

On 16/08/2017 13:46, Alex Samad wrote:

On 16 August 2017 at 16:16, Michael Paquier <michael.paquier@gmail.com <mailto:michael.paquier@gmail.com>> wrote:

On Wed, Aug 16, 2017 at 2:32 PM, Alex Samad <alex@samad.com.au <mailto:alex@samad.com.au>> wrote:

1) why did it fill up this time and not previously
I add this
archive_command = '/bin/true'
wal_keep_segments = 1000 # <<< I'm guessing its this

2) how do I fix up, can I just remove the files from the pg_xlog directory

Don't do that. those files are managed by Postgres so you may finish
with a corrupted cluster. Instead you should lower the value of

Too late, its okay its a learning experience.

wal_keep_segments, reload the server parameters, and then enforce two
checkpoints to force WAL segments to be recycled. Note that this

how do I force check points

checkpoint ;
(the ; is not meant as a smiley or whatever )

depends also on the values of checkpoint_segments
(max_wal_size/min_wal_size in Postgres 9.5 and onwards).
--
Michael

thanks

--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

#5Alex Samad
alex@samad.com.au
In reply to: Achilleas Mantzios (#4)
Re: Begginers question

Great I will add it to my notes.

Thanks

On 16 August 2017 at 20:55, Achilleas Mantzios <achill@matrix.gatewaynet.com

Show quoted text

wrote:

On 16/08/2017 13:46, Alex Samad wrote:

On 16 August 2017 at 16:16, Michael Paquier <michael.paquier@gmail.com>
wrote:

On Wed, Aug 16, 2017 at 2:32 PM, Alex Samad <alex@samad.com.au> wrote:

1) why did it fill up this time and not previously
I add this
archive_command = '/bin/true'
wal_keep_segments = 1000 # <<< I'm guessing its this

2) how do I fix up, can I just remove the files from the pg_xlog

directory

Don't do that. those files are managed by Postgres so you may finish
with a corrupted cluster. Instead you should lower the value of

Too late, its okay its a learning experience.

wal_keep_segments, reload the server parameters, and then enforce two
checkpoints to force WAL segments to be recycled. Note that this

how do I force check points

checkpoint ;
(the ; is not meant as a smiley or whatever )

depends also on the values of checkpoint_segments
(max_wal_size/min_wal_size in Postgres 9.5 and onwards).
--
Michael

thanks

--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

#6Alex Samad
alex@samad.com.au
In reply to: Achilleas Mantzios (#4)
Re: Begginers question

On 16 August 2017 at 20:55, Achilleas Mantzios <achill@matrix.gatewaynet.com

wrote:

On 16/08/2017 13:46, Alex Samad wrote:

On 16 August 2017 at 16:16, Michael Paquier <michael.paquier@gmail.com>
wrote:

On Wed, Aug 16, 2017 at 2:32 PM, Alex Samad <alex@samad.com.au> wrote:

1) why did it fill up this time and not previously
I add this
archive_command = '/bin/true'
wal_keep_segments = 1000 # <<< I'm guessing its this

2) how do I fix up, can I just remove the files from the pg_xlog

directory

How can I work out how much space this is going to use,
I see in the comments a segment is 16M, so 1000 would have been 16G, So I
thought I would set it at 100 so 1.6G. but it ended up using about 4.5G. So
now I am confused

Show quoted text

Don't do that. those files are managed by Postgres so you may finish
with a corrupted cluster. Instead you should lower the value of

Too late, its okay its a learning experience.

wal_keep_segments, reload the server parameters, and then enforce two
checkpoints to force WAL segments to be recycled. Note that this

how do I force check points

checkpoint ;
(the ; is not meant as a smiley or whatever )

depends also on the values of checkpoint_segments
(max_wal_size/min_wal_size in Postgres 9.5 and onwards).
--
Michael

thanks

--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt