Re: pg_xlog and standby - SOLVED

Started by Roberto Scattiniabout 18 years ago4 messagesgeneral
Jump to latest
#1Roberto Scattini
roberto.scattini@gmail.com

On Jan 23, 2008 11:07 PM, Greg Smith <gsmith@gregsmith.com> wrote:

On Wed, 23 Jan 2008, Roberto Scattini wrote:

the problem that im having is that i have A LOT of
archive files on pg_xlog dir, and thats because the archive_command
keeps failing (the standby server had filled his disk with archives
received but not proccesed), so now, i dont know how i can remove
those files and start again...

Under normal operation the checkpoint process will look at the number of
already created archive files, keep around up to (2*checkpoint_segments+1)
of them for future use, and delete the rest of them. You never delete
them yourself, the server will take care of that automatically once it
gets to where it makes that decision. If you set checkpoint_segments to
some very high number they can end up taking many GB worth of storage,
increasing that parameter has at least two costs associated with it (the
other being a longer recovery time).

i had commented archive_command in the main server but i only made a
reload. now i made a restart and almost all files in $DATA/pg_xlog/
dir are gone, and the server works properly :D

question: all the parameters in postgresql.conf need a restart to take effect?

thanks all for your help.

--
Roberto Scattini
___ _
))_) __ )L __
((__)(('(( ((_)

#2Erik Jones
erik@myemma.com
In reply to: Roberto Scattini (#1)

On Jan 24, 2008, at 6:09 AM, Roberto Scattini wrote:

On Jan 23, 2008 11:07 PM, Greg Smith <gsmith@gregsmith.com> wrote:

On Wed, 23 Jan 2008, Roberto Scattini wrote:

the problem that im having is that i have A LOT of
archive files on pg_xlog dir, and thats because the archive_command
keeps failing (the standby server had filled his disk with archives
received but not proccesed), so now, i dont know how i can remove
those files and start again...

Under normal operation the checkpoint process will look at the
number of
already created archive files, keep around up to
(2*checkpoint_segments+1)
of them for future use, and delete the rest of them. You never
delete
them yourself, the server will take care of that automatically
once it
gets to where it makes that decision. If you set
checkpoint_segments to
some very high number they can end up taking many GB worth of
storage,
increasing that parameter has at least two costs associated with
it (the
other being a longer recovery time).

i had commented archive_command in the main server but i only made a
reload. now i made a restart and almost all files in $DATA/pg_xlog/
dir are gone, and the server works properly :D

question: all the parameters in postgresql.conf need a restart to
take effect?

thanks all for your help.

Ah, yes, that's a gotcha with the archive_command, at least I know it
was a gotme at one point :) To disable archiving, set
archive_command="", commenting it out won't change it. The only
config paramaters that require a restart to take effect are those
that are specifically noted as such in the manual section on server
configuration. However, commenting a config is not necessarily
equivalent to disabling something.

Erik Jones

DBA | Emma®
erik@myemma.com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

#3Greg Smith
gsmith@gregsmith.com
In reply to: Erik Jones (#2)

On Thu, 24 Jan 2008, Erik Jones wrote:

To disable archiving, set archive_command="", commenting it out won't
change it...However, commenting a config is not necessarily equivalent
to disabling something.

This is actually a problem that is corrected in the upcoming 8.3 release.

From those release notes:

"Commenting out a parameter in postgresql.conf now causes it to revert to
its default value. [In 8.2 and earlier releases] commenting out an entry
left the parameter's value unchanged until the next server restart."

This is probably why Roberto didn't see the expected behavior until a
server restart.

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD

#4Roberto Scattini
roberto.scattini@gmail.com
In reply to: Greg Smith (#3)

On Jan 24, 2008 4:30 PM, Greg Smith <gsmith@gregsmith.com> wrote:

On Thu, 24 Jan 2008, Erik Jones wrote:

To disable archiving, set archive_command="", commenting it out won't
change it...However, commenting a config is not necessarily equivalent
to disabling something.

This is actually a problem that is corrected in the upcoming 8.3 release.
From those release notes:

"Commenting out a parameter in postgresql.conf now causes it to revert to
its default value. [In 8.2 and earlier releases] commenting out an entry
left the parameter's value unchanged until the next server restart."

This is probably why Roberto didn't see the expected behavior until a
server restart.

in fact, googling for the problem i found those release notes that led
me to think that the restart was necessary...
:D

--
Roberto Scattini
___ _
))_) __ )L __
((__)(('(( ((_)