pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Cannot change archive_command with a reload
18+ messages / 7 participants
[nested] [flat]

* Cannot change archive_command with a reload
@ 2014-02-02 15:52 CS DBA <cs_dba@consistentstate.com>
  2014-02-02 15:58 ` Re: Cannot change archive_command with a reload Strahinja Kustudić <strahinjak@nordeus.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  0 siblings, 2 replies; 18+ messages in thread

From: CS DBA @ 2014-02-02 15:52 UTC (permalink / raw)
  To: pgsql-admin; +Cc: cs_dba@consistentstate.com

Hi all;

we have a cluster running with an archive command that is failing.
I tried a reload and the value does not change

Tried a set_config and I get this error:

select set_config ('archive_command', 'cp %p /data/wal_tmp/%f && mv 
/data/wal_tmp/%f /data/wal/&f', 'false');
ERROR:  parameter "archive_command" cannot be changed now


Thoughts?

Thanks in advance


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



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
@ 2014-02-02 15:58 ` Strahinja Kustudić <strahinjak@nordeus.com>
  2014-02-02 16:03   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  1 sibling, 1 reply; 18+ messages in thread

From: Strahinja Kustudić @ 2014-02-02 15:58 UTC (permalink / raw)
  To: CS DBA <cs_dba@consistentstate.com>; +Cc: pgsql-admin

What version of Postgres are you using? What OS? Have you tried editing the
archive_command in postgresql.conf and then reload?

Strahinja Kustudić | Lead System Engineer | Nordeus


On Sun, Feb 2, 2014 at 4:52 PM, CS DBA <cs_dba@consistentstate.com> wrote:

> Hi all;
>
> we have a cluster running with an archive command that is failing.
> I tried a reload and the value does not change
>
> Tried a set_config and I get this error:
>
> select set_config ('archive_command', 'cp %p /data/wal_tmp/%f && mv
> /data/wal_tmp/%f /data/wal/&f', 'false');
> ERROR:  parameter "archive_command" cannot be changed now
>
>
> Thoughts?
>
> Thanks in advance
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 15:58 ` Re: Cannot change archive_command with a reload Strahinja Kustudić <strahinjak@nordeus.com>
@ 2014-02-02 16:03   ` CS DBA <cs_dba@consistentstate.com>
  0 siblings, 0 replies; 18+ messages in thread

From: CS DBA @ 2014-02-02 16:03 UTC (permalink / raw)
  To: Strahinja Kustudić <strahinjak@nordeus.com>; +Cc: pgsql-admin

We're running version 9.2.4,  on Redhat 5.1
I have tried changing the config file and running "service 
postgresql-9.2 reload"

I've also tried (as user postgres): pg_ctl -D /var/lib/pgsql/9.2/data reload

no luck with either approach




  On 2/2/14, 8:58 AM, Strahinja Kustudić wrote:
> What version of Postgres are you using? What OS? Have you tried 
> editing the archive_command in postgresql.conf and then reload?
>
> Strahinja Kustudić| Lead System Engineer | Nordeus
>
>
> On Sun, Feb 2, 2014 at 4:52 PM, CS DBA <cs_dba@consistentstate.com 
> <mailto:cs_dba@consistentstate.com>> wrote:
>
>     Hi all;
>
>     we have a cluster running with an archive command that is failing.
>     I tried a reload and the value does not change
>
>     Tried a set_config and I get this error:
>
>     select set_config ('archive_command', 'cp %p /data/wal_tmp/%f &&
>     mv /data/wal_tmp/%f /data/wal/&f', 'false');
>     ERROR:  parameter "archive_command" cannot be changed now
>
>
>     Thoughts?
>
>     Thanks in advance
>
>
>     -- 
>     Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org
>     <mailto:pgsql-admin@postgresql.org>)
>     To make changes to your subscription:
>     http://www.postgresql.org/mailpref/pgsql-admin
>
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
@ 2014-02-02 16:19 ` Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  1 sibling, 1 reply; 18+ messages in thread

From: Raghavendra @ 2014-02-02 16:19 UTC (permalink / raw)
  To: CS DBA <cs_dba@consistentstate.com>; +Cc: pgsql-admin

On Sun, Feb 2, 2014 at 9:22 PM, CS DBA <cs_dba@consistentstate.com> wrote:

> Hi all;
>
> we have a cluster running with an archive command that is failing.
> I tried a reload and the value does not change
>
>
Reload with new value won't work until you fix the failing archive_command.

Eg:-

ps -ef | grep arch
postgres 29743 29736  0 Jan30 ?        00:00:00 postgres: archiver process
  failed on 00000001000000010000003D

and it might cause same error you are experiencing as

postgres=# select set_config('archive_command','cp %p
/opt/PostgreSQL/9.3/a93/%f',false);
ERROR:  parameter "archive_command" cannot be changed now

So, fix the archive_command first and then give new changes.

Tried a set_config and I get this error:
>
> select set_config ('archive_command', 'cp %p /data/wal_tmp/%f && mv
> /data/wal_tmp/%f /data/wal/&f', 'false');
> ERROR:  parameter "archive_command" cannot be changed now
>
>
If your archive_command pointing to "/data/wal_tmp" then please ensure that
directory exists there. If that directory not present then archive process
fail to copy the transaction logs. When archiver process in failed state
you cannot apply any new changes to the archive_command it will fail.

Also, am surprised to see "mv" command, basically the archive_command meant
to have a copies of pg_xlogs but not any OS related directory movements.

Link on archive_command:
http://www.postgresql.org/docs/9.2/static/runtime-config-wal.html


---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
@ 2014-02-02 16:26   ` CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:32     ` Re: Cannot change archive_command with a reload Erik Darling <edarling80@gmail.com>
  2014-02-02 16:51     ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:52     ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  0 siblings, 3 replies; 18+ messages in thread

From: CS DBA @ 2014-02-02 16:26 UTC (permalink / raw)
  To: Raghavendra <raghavendra.rao@enterprisedb.com>; +Cc: pgsql-admin

On 2/2/14, 9:19 AM, Raghavendra wrote:
>
>
> On Sun, Feb 2, 2014 at 9:22 PM, CS DBA <cs_dba@consistentstate.com 
> <mailto:cs_dba@consistentstate.com>> wrote:
>
>     Hi all;
>
>     we have a cluster running with an archive command that is failing.
>     I tried a reload and the value does not change
>
>
> Reload with new value won't work until you fix the failing 
> archive_command.
>
> Eg:-
>
> ps -ef | grep arch
> postgres 29743 29736  0 Jan30 ?  00:00:00 postgres: archiver process   
> failed on 00000001000000010000003D
>
> and it might cause same error you are experiencing as
>
> postgres=# select set_config('archive_command','cp %p 
> /opt/PostgreSQL/9.3/a93/%f',false);
> ERROR:  parameter "archive_command" cannot be changed now
>
> So, fix the archive_command first and then give new changes.
>
>     Tried a set_config and I get this error:
>
>     select set_config ('archive_command', 'cp %p /data/wal_tmp/%f &&
>     mv /data/wal_tmp/%f /data/wal/&f', 'false');
>     ERROR:  parameter "archive_command" cannot be changed now
>
>
> If your archive_command pointing to "/data/wal_tmp" then please ensure 
> that directory exists there. If that directory not present then 
> archive process fail to copy the transaction logs. When archiver 
> process in failed state you cannot apply any new changes to the 
> archive_command it will fail.
>
> Also, am surprised to see "mv" command, basically the archive_command 
> meant to have a copies of pg_xlogs but not any OS related directory 
> movements.

we want to copy the file to /data/wal_tmp, then do a mv to /data/wal so 
our process that ships a copy to the standby servers never see's a 
partial file (since it watches /data/wal)

>
> Link on archive_command:
> http://www.postgresql.org/docs/9.2/static/runtime-config-wal.html
>
>
> ---
> Regards,
> Raghavendra
> EnterpriseDB Corporation
> Blog: http://raghavt.blogspot.com/
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
@ 2014-02-02 16:32     ` Erik Darling <edarling80@gmail.com>
  2014-02-02 17:11       ` Re: Cannot change archive_command with a reload deepak <deepak.05pal@gmail.com>
  2 siblings, 1 reply; 18+ messages in thread

From: Erik Darling @ 2014-02-02 16:32 UTC (permalink / raw)
  To: pgsql-admin

Unsubscribe


On Sun, Feb 2, 2014 at 11:26 AM, CS DBA <cs_dba@consistentstate.com> wrote:

>  On 2/2/14, 9:19 AM, Raghavendra wrote:
>
>
>
> On Sun, Feb 2, 2014 at 9:22 PM, CS DBA <cs_dba@consistentstate.com> wrote:
>
>> Hi all;
>>
>> we have a cluster running with an archive command that is failing.
>> I tried a reload and the value does not change
>>
>>
>  Reload with new value won't work until you fix the failing
> archive_command.
>
>  Eg:-
>
>  ps -ef | grep arch
> postgres 29743 29736  0 Jan30 ?        00:00:00 postgres: archiver process
>   failed on 00000001000000010000003D
>
>  and it might cause same error you are experiencing as
>
>  postgres=# select set_config('archive_command','cp %p
> /opt/PostgreSQL/9.3/a93/%f',false);
>  ERROR:  parameter "archive_command" cannot be changed now
>
>  So, fix the archive_command first and then give new changes.
>
>  Tried a set_config and I get this error:
>>
>> select set_config ('archive_command', 'cp %p /data/wal_tmp/%f && mv
>> /data/wal_tmp/%f /data/wal/&f', 'false');
>> ERROR:  parameter "archive_command" cannot be changed now
>>
>>
>  If your archive_command pointing to "/data/wal_tmp" then please ensure
> that directory exists there. If that directory not present then archive
> process fail to copy the transaction logs. When archiver process in failed
> state you cannot apply any new changes to the archive_command it will fail.
>
>  Also, am surprised to see "mv" command, basically the archive_command
> meant to have a copies of pg_xlogs but not any OS related directory
> movements.
>
>
> we want to copy the file to /data/wal_tmp, then do a mv to /data/wal so
> our process that ships a copy to the standby servers never see's a partial
> file (since it watches /data/wal)
>
>
>  Link on archive_command:
>  http://www.postgresql.org/docs/9.2/static/runtime-config-wal.html
>
>
>  ---
> Regards,
> Raghavendra
> EnterpriseDB Corporation
> Blog: http://raghavt.blogspot.com/
>
>
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:32     ` Re: Cannot change archive_command with a reload Erik Darling <edarling80@gmail.com>
@ 2014-02-02 17:11       ` deepak <deepak.05pal@gmail.com>
  0 siblings, 0 replies; 18+ messages in thread

From: deepak @ 2014-02-02 17:11 UTC (permalink / raw)
  To: Erik Darling <edarling80@gmail.com>; pgsql-admin

Please  Unsubscribe me

On Sun, Feb 2, 2014 at 11:32 AM, Erik Darling <edarling80@gmail.com> wrote:

> Unsubscribe
>
>
> On Sun, Feb 2, 2014 at 11:26 AM, CS DBA <cs_dba@consistentstate.com>wrote:
>
>>  On 2/2/14, 9:19 AM, Raghavendra wrote:
>>
>>
>>
>> On Sun, Feb 2, 2014 at 9:22 PM, CS DBA <cs_dba@consistentstate.com>wrote:
>>
>>> Hi all;
>>>
>>> we have a cluster running with an archive command that is failing.
>>> I tried a reload and the value does not change
>>>
>>>
>> Reload with new value won't work until you fix the failing
>> archive_command.
>>
>> Eg:-
>>
>>  ps -ef | grep arch
>> postgres 29743 29736  0 Jan30 ?        00:00:00 postgres: archiver
>> process   failed on 00000001000000010000003D
>>
>> and it might cause same error you are experiencing as
>>
>> postgres=# select set_config('archive_command','cp %p
>> /opt/PostgreSQL/9.3/a93/%f',false);
>> ERROR:  parameter "archive_command" cannot be changed now
>>
>> So, fix the archive_command first and then give new changes.
>>
>> Tried a set_config and I get this error:
>>>
>>> select set_config ('archive_command', 'cp %p /data/wal_tmp/%f && mv
>>> /data/wal_tmp/%f /data/wal/&f', 'false');
>>> ERROR:  parameter "archive_command" cannot be changed now
>>>
>>>
>>  If your archive_command pointing to "/data/wal_tmp" then please ensure
>> that directory exists there. If that directory not present then archive
>> process fail to copy the transaction logs. When archiver process in failed
>> state you cannot apply any new changes to the archive_command it will fail.
>>
>> Also, am surprised to see "mv" command, basically the archive_command
>> meant to have a copies of pg_xlogs but not any OS related directory
>> movements.
>>
>>
>> we want to copy the file to /data/wal_tmp, then do a mv to /data/wal so
>> our process that ships a copy to the standby servers never see's a partial
>> file (since it watches /data/wal)
>>
>>
>> Link on archive_command:
>> http://www.postgresql.org/docs/9.2/static/runtime-config-wal.html
>>
>>
>> ---
>> Regards,
>> Raghavendra
>> EnterpriseDB Corporation
>> Blog: http://raghavt.blogspot.com/
>>
>>
>>
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
@ 2014-02-02 16:51     ` Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:57       ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 17:03       ` Re: Cannot change archive_command with a reload Scott Ribe <scott_ribe@elevated-dev.com>
  2 siblings, 2 replies; 18+ messages in thread

From: Raghavendra @ 2014-02-02 16:51 UTC (permalink / raw)
  To: CS DBA <cs_dba@consistentstate.com>; +Cc: pgsql-admin

On Sun, Feb 2, 2014 at 9:56 PM, CS DBA <cs_dba@consistentstate.com> wrote:

>  On 2/2/14, 9:19 AM, Raghavendra wrote:
>
>
>
> On Sun, Feb 2, 2014 at 9:22 PM, CS DBA <cs_dba@consistentstate.com> wrote:
>
>> Hi all;
>>
>> we have a cluster running with an archive command that is failing.
>> I tried a reload and the value does not change
>>
>>
>  Reload with new value won't work until you fix the failing
> archive_command.
>
>  Eg:-
>
>  ps -ef | grep arch
> postgres 29743 29736  0 Jan30 ?        00:00:00 postgres: archiver process
>   failed on 00000001000000010000003D
>
>  and it might cause same error you are experiencing as
>
>  postgres=# select set_config('archive_command','cp %p
> /opt/PostgreSQL/9.3/a93/%f',false);
>  ERROR:  parameter "archive_command" cannot be changed now
>
>  So, fix the archive_command first and then give new changes.
>
>  Tried a set_config and I get this error:
>>
>> select set_config ('archive_command', 'cp %p /data/wal_tmp/%f && mv
>> /data/wal_tmp/%f /data/wal/&f', 'false');
>> ERROR:  parameter "archive_command" cannot be changed now
>>
>>
>  If your archive_command pointing to "/data/wal_tmp" then please ensure
> that directory exists there. If that directory not present then archive
> process fail to copy the transaction logs. When archiver process in failed
> state you cannot apply any new changes to the archive_command it will fail.
>
>  Also, am surprised to see "mv" command, basically the archive_command
> meant to have a copies of pg_xlogs but not any OS related directory
> movements.
>
>
> we want to copy the file to /data/wal_tmp, then do a mv to /data/wal so
> our process that ships a copy to the standby servers never see's a partial
> file (since it watches /data/wal)
>

'cp %p /data/wal_tmp/%f && mv /data/wal_tmp/%f /data/wal/&f',

Seems you are missing something here, you have two action commands in your
archive_command. One is copy "cp" and another is "mv" move. Once you are
copying file to the directory you are moving that entire directory and not
keeping the place available for archiver process to copy next file in that
location on its next arrival.

Because, every transaction logs first go to archive directory as you
mentioned "cp %p /data/wal_tmp/%f". Next it will execute the other command
too since its one command string, i.e, move "mv /data/wal_tmp/%f
/data/wal&f".

Hence, you need to have unique place for archives and it should not be
disturbed in any case. If you want to ship a copy to standby server then
have another directory with same set of copies at OS level.

--Raghav

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:51     ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
@ 2014-02-02 16:57       ` CS DBA <cs_dba@consistentstate.com>
  2014-02-02 17:04         ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-03 15:15         ` Re: Cannot change archive_command with a reload Luca Ferrari <fluca1978@infinito.it>
  1 sibling, 2 replies; 18+ messages in thread

From: CS DBA @ 2014-02-02 16:57 UTC (permalink / raw)
  To: Raghavendra <raghavendra.rao@enterprisedb.com>; +Cc: pgsql-admin

On 2/2/14, 9:51 AM, Raghavendra wrote:
>
> On Sun, Feb 2, 2014 at 9:56 PM, CS DBA <cs_dba@consistentstate.com 
> <mailto:cs_dba@consistentstate.com>> wrote:
>
>     On 2/2/14, 9:19 AM, Raghavendra wrote:
>>
>>
>>     On Sun, Feb 2, 2014 at 9:22 PM, CS DBA
>>     <cs_dba@consistentstate.com <mailto:cs_dba@consistentstate.com>>
>>     wrote:
>>
>>         Hi all;
>>
>>         we have a cluster running with an archive command that is
>>         failing.
>>         I tried a reload and the value does not change
>>
>>
>>     Reload with new value won't work until you fix the failing
>>     archive_command.
>>
>>     Eg:-
>>
>>     ps -ef | grep arch
>>     postgres 29743 29736  0 Jan30 ?        00:00:00 postgres:
>>     archiver process   failed on 00000001000000010000003D
>>
>>     and it might cause same error you are experiencing as
>>
>>     postgres=# select set_config('archive_command','cp %p
>>     /opt/PostgreSQL/9.3/a93/%f',false);
>>     ERROR:  parameter "archive_command" cannot be changed now
>>
>>     So, fix the archive_command first and then give new changes.
>>
>>         Tried a set_config and I get this error:
>>
>>         select set_config ('archive_command', 'cp %p /data/wal_tmp/%f
>>         && mv /data/wal_tmp/%f /data/wal/&f', 'false');
>>         ERROR:  parameter "archive_command" cannot be changed now
>>
>>
>>     If your archive_command pointing to "/data/wal_tmp" then please
>>     ensure that directory exists there. If that directory not present
>>     then archive process fail to copy the transaction logs. When
>>     archiver process in failed state you cannot apply any new changes
>>     to the archive_command it will fail.
>>
>>     Also, am surprised to see "mv" command, basically the
>>     archive_command meant to have a copies of pg_xlogs but not any OS
>>     related directory movements.
>
>     we want to copy the file to /data/wal_tmp, then do a mv to
>     /data/wal so our process that ships a copy to the standby servers
>     never see's a partial file (since it watches /data/wal)
>
>
> 'cp %p /data/wal_tmp/%f && mv /data/wal_tmp/%f /data/wal/&f',
>
> Seems you are missing something here, you have two action commands in 
> your archive_command. One is copy "cp" and another is "mv" move. Once 
> you are copying file to the directory you are moving that entire 
> directory and not keeping the place available for archiver process to 
> copy next file in that location on its next arrival.
>
> Because, every transaction logs first go to archive directory as you 
> mentioned "cp %p /data/wal_tmp/%f". Next it will execute the other 
> command too since its one command string, i.e, move "mv 
> /data/wal_tmp/%f /data/wal&f".
>
> Hence, you need to have unique place for archives and it should not be 
> disturbed in any case. If you want to ship a copy to standby server 
> then have another directory with same set of copies at OS level.
>
> --Raghav
>
My issue is the &f instead of %f at the end.  However here's the intent:

if the first command is true (cp %p /data/wal_tmp/%f) then I want the 
second command to execute (mv /data/wal_tmp/%f /data/wal/%f)

since both directories are in the same file system the mv is immediate 
so any process watching for files to show up in /data/wal will never see 
a partial file

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:51     ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:57       ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
@ 2014-02-02 17:04         ` Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 17:08           ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  1 sibling, 1 reply; 18+ messages in thread

From: Raghavendra @ 2014-02-02 17:04 UTC (permalink / raw)
  To: CS DBA <cs_dba@consistentstate.com>; +Cc: pgsql-admin

>
>
> My issue is the &f instead of %f at the end.  However here's the intent:
>
> if the first command is true (cp %p /data/wal_tmp/%f) then I want the
> second command to execute (mv /data/wal_tmp/%f /data/wal/%f)
>
>
In this case archiver process fail, because there won't be directory called
/data/wal_tmp anymore with your your "mv" command.

> since both directories are in the same file system the mv is immediate so
> any process watching for files to show up in /data/wal will never see a
> partial file
>
>
"partial file" ?
Its 16MB file in any case there won't be any partial files, because after
completion of writing 16mb file in xlog it will come to archive location
else not.

--Raghav

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:51     ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:57       ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 17:04         ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
@ 2014-02-02 17:08           ` CS DBA <cs_dba@consistentstate.com>
  2014-02-02 17:19             ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  0 siblings, 1 reply; 18+ messages in thread

From: CS DBA @ 2014-02-02 17:08 UTC (permalink / raw)
  To: Raghavendra <raghavendra.rao@enterprisedb.com>; +Cc: pgsql-admin

On 2/2/14, 10:04 AM, Raghavendra wrote:
>
>
>     My issue is the &f instead of %f at the end. However here's the
>     intent:
>
>     if the first command is true (cp %p /data/wal_tmp/%f) then I want
>     the second command to execute (mv /data/wal_tmp/%f /data/wal/%f)
>
>
> In this case archiver process fail, because there won't be directory 
> called /data/wal_tmp anymore with your your "mv" command.
were moving the file %f not the directory


>     since both directories are in the same file system the mv is
>     immediate so any process watching for files to show up in
>     /data/wal will never see a partial file
>
>
> "partial file" ?
> Its 16MB file in any case there won't be any partial files, because 
> after completion of writing 16mb file in xlog it will come to archive 
> location else not.

we dont want the log shipper process to ship a file that is still being 
copied from pg_xlog



>
> --Raghav
>
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:51     ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:57       ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 17:04         ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 17:08           ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
@ 2014-02-02 17:19             ` Raghavendra <raghavendra.rao@enterprisedb.com>
  0 siblings, 0 replies; 18+ messages in thread

From: Raghavendra @ 2014-02-02 17:19 UTC (permalink / raw)
  To: CS DBA <cs_dba@consistentstate.com>; +Cc: pgsql-admin

>
>
>  In this case archiver process fail, because there won't be directory
> called /data/wal_tmp anymore with your your "mv" command.
>
> were moving the file %f not the directory
>
> My bad, I overlooked. Sorry for the inconvenience.

 since both directories are in the same file system the mv is immediate so
>> any process watching for files to show up in /data/wal will never see a
>> partial file
>>
>>
>  "partial file" ?
>  Its 16MB file in any case there won't be any partial files, because after
> completion of writing 16mb file in xlog it will come to archive location
> else not.
>
> we dont want the log shipper process to ship a file that is still being
> copied from pg_xlog
>
>
What was the previous archive_command string ?

and

ps -ef | grep arch   output?


--Raghav

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:51     ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:57       ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
@ 2014-02-03 15:15         ` Luca Ferrari <fluca1978@infinito.it>
  2014-02-03 15:20           ` Re: Cannot change archive_command with a reload Scott Ribe <scott_ribe@elevated-dev.com>
  2014-02-03 15:21           ` Re: Cannot change archive_command with a reload Scott Ribe <scott_ribe@elevated-dev.com>
  1 sibling, 2 replies; 18+ messages in thread

From: Luca Ferrari @ 2014-02-03 15:15 UTC (permalink / raw)
  To: CS DBA <cs_dba@consistentstate.com>; +Cc: Raghavendra <raghavendra.rao@enterprisedb.com>; pgsql-admin

On Sun, Feb 2, 2014 at 5:57 PM, CS DBA <cs_dba@consistentstate.com> wrote:
> On 2/2/14, 9:51 AM, Raghavendra wrote:
> My issue is the &f instead of %f at the end.  However here's the intent:
>
> if the first command is true (cp %p /data/wal_tmp/%f) then I want the second
> command to execute (mv /data/wal_tmp/%f /data/wal/%f)
>

I suggest you to wrap the commands in a shell script and to get a log
of the activity, at least in the beginning, to see what is not
working. Moreover, having a script will allow you to extend the logic.


> since both directories are in the same file system the mv is immediate so
> any process watching for files to show up in /data/wal will never see a
> partial file

As explained by others, the issue of having partial files is not an
issue at all.

Luca


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



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:51     ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:57       ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-03 15:15         ` Re: Cannot change archive_command with a reload Luca Ferrari <fluca1978@infinito.it>
@ 2014-02-03 15:20           ` Scott Ribe <scott_ribe@elevated-dev.com>
  1 sibling, 0 replies; 18+ messages in thread

From: Scott Ribe @ 2014-02-03 15:20 UTC (permalink / raw)
  To: Luca Ferrari <fluca1978@infinito.it>; +Cc: CS DBA <cs_dba@consistentstate.com>; pgsql-admin

On Feb 3, 2014, at 8:15 AM, Luca Ferrari <fluca1978@infinito.it> wrote:

> As explained by others, the issue of having partial files is not an
> issue at all.

It most certainly is an issue--the cp command is not atomic.

-- 
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice






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



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:51     ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:57       ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-03 15:15         ` Re: Cannot change archive_command with a reload Luca Ferrari <fluca1978@infinito.it>
@ 2014-02-03 15:21           ` Scott Ribe <scott_ribe@elevated-dev.com>
  1 sibling, 0 replies; 18+ messages in thread

From: Scott Ribe @ 2014-02-03 15:21 UTC (permalink / raw)
  To: Luca Ferrari <fluca1978@infinito.it>; +Cc: CS DBA <cs_dba@consistentstate.com>; pgsql-admin

On Feb 3, 2014, at 8:15 AM, Luca Ferrari <fluca1978@infinito.it> wrote:

> As explained by others, the issue of having partial files is not an
> issue at all.

I apologize for the tone of my post--early AM and as soon as I hit send, I realized how harsh it might seem.


-- 
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice






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



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:51     ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
@ 2014-02-02 17:03       ` Scott Ribe <scott_ribe@elevated-dev.com>
  2014-02-02 17:06         ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  1 sibling, 1 reply; 18+ messages in thread

From: Scott Ribe @ 2014-02-02 17:03 UTC (permalink / raw)
  To: Raghavendra <raghavendra.rao@enterprisedb.com>; +Cc: CS DBA <cs_dba@consistentstate.com>; pgsql-admin

On Feb 2, 2014, at 9:51 AM, Raghavendra <raghavendra.rao@enterprisedb.com> wrote:

> Once you are copying file to the directory you are moving that entire directory and not keeping the place available for archiver process to copy next file in that location on its next arrival.

No, he's just mv'ing the file, not the directory.

-- 
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice






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



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:51     ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 17:03       ` Re: Cannot change archive_command with a reload Scott Ribe <scott_ribe@elevated-dev.com>
@ 2014-02-02 17:06         ` Raghavendra <raghavendra.rao@enterprisedb.com>
  0 siblings, 0 replies; 18+ messages in thread

From: Raghavendra @ 2014-02-02 17:06 UTC (permalink / raw)
  To: Scott Ribe <scott_ribe@elevated-dev.com>; +Cc: CS DBA <cs_dba@consistentstate.com>; pgsql-admin

On Sun, Feb 2, 2014 at 10:33 PM, Scott Ribe <scott_ribe@elevated-dev.com>wrote:

> On Feb 2, 2014, at 9:51 AM, Raghavendra <raghavendra.rao@enterprisedb.com>
> wrote:
>
> > Once you are copying file to the directory you are moving that entire
> directory and not keeping the place available for archiver process to copy
> next file in that location on its next arrival.
>
> No, he's just mv'ing the file, not the directory.
>
>
Yeah, my bad. I overlooked...

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: Cannot change archive_command with a reload
  2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
  2014-02-02 16:19 ` Re: Cannot change archive_command with a reload Raghavendra <raghavendra.rao@enterprisedb.com>
  2014-02-02 16:26   ` Re: Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
@ 2014-02-02 16:52     ` CS DBA <cs_dba@consistentstate.com>
  2 siblings, 0 replies; 18+ messages in thread

From: CS DBA @ 2014-02-02 16:52 UTC (permalink / raw)
  To: ; +Cc: pgsql-admin

On 2/2/14, 9:26 AM, CS DBA wrote:
> On 2/2/14, 9:19 AM, Raghavendra wrote:
>>
>>
>> On Sun, Feb 2, 2014 at 9:22 PM, CS DBA <cs_dba@consistentstate.com 
>> <mailto:cs_dba@consistentstate.com>> wrote:
>>
>>     Hi all;
>>
>>     we have a cluster running with an archive command that is failing.
>>     I tried a reload and the value does not change
>>
>>
>> Reload with new value won't work until you fix the failing 
>> archive_command.
>>
>> Eg:-
>>
>> ps -ef | grep arch
>> postgres 29743 29736  0 Jan30 ?  00:00:00 postgres: archiver process 
>>   failed on 00000001000000010000003D
>>
>> and it might cause same error you are experiencing as
>>
>> postgres=# select set_config('archive_command','cp %p 
>> /opt/PostgreSQL/9.3/a93/%f',false);
>> ERROR:  parameter "archive_command" cannot be changed now
>>
>> So, fix the archive_command first and then give new changes.
>>
>>     Tried a set_config and I get this error:
>>
>>     select set_config ('archive_command', 'cp %p /data/wal_tmp/%f &&
>>     mv /data/wal_tmp/%f /data/wal/&f', 'false');
>>     ERROR:  parameter "archive_command" cannot be changed now
>>
>>
>> If your archive_command pointing to "/data/wal_tmp" then please 
>> ensure that directory exists there. If that directory not present 
>> then archive process fail to copy the transaction logs. When archiver 
>> process in failed state you cannot apply any new changes to the 
>> archive_command it will fail.
>>
>> Also, am surprised to see "mv" command, basically the archive_command 
>> meant to have a copies of pg_xlogs but not any OS related directory 
>> movements.
>
> we want to copy the file to /data/wal_tmp, then do a mv to /data/wal 
> so our process that ships a copy to the standby servers never see's a 
> partial file (since it watches /data/wal)
>
>>
>> Link on archive_command:
>> http://www.postgresql.org/docs/9.2/static/runtime-config-wal.html
>>
>>
>> ---
>> Regards,
>> Raghavendra
>> EnterpriseDB Corporation
>> Blog: http://raghavt.blogspot.com/
>>
>


So, I found that the archive command has a typeo (using a &f instead of 
a %f at the end):
cp %p /data/wal_tmp/%f && mv /data/wal_tmp/%f /data/wal/*&*f


I don't see any way to make the command as is "work" so I suspect the 
only option is a restart.

Question:  as a growing stack of archive commands fails (see log entry 
example below), is it going to take an increasingly longer and longer 
time to do a restart?

Log entry:
sh: f: command not found
11631    2014-02-02 09:49:41 MST [2014-02-02 01:04:54 MST] [3820] LOG:  
archive command failed with exit code 127
11631    2014-02-02 09:49:41 MST [2014-02-02 01:04:54 MST] [3821] 
DETAIL:  The failed archive command was: test ! -f 
/data/wal/00000001000006E50000001C && cp 
pg_xlog/00000001000006E50000001C /data/wal_tmp/00000001000006E50000001C 
&& mv /data/wal_tmp/00000001000006E50000001C /data/wal/&f
11631    2014-02-02 09:49:41 MST [2014-02-02 01:04:54 MST] [3822] 
WARNING:  transaction log file "00000001000006E50000001C" could not be 
archived: too many failures

^ permalink  raw  reply  [nested|flat] 18+ messages in thread


end of thread, other threads:[~2014-02-03 15:21 UTC | newest]

Thread overview: 18+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-02-02 15:52 Cannot change archive_command with a reload CS DBA <cs_dba@consistentstate.com>
2014-02-02 15:58 ` Strahinja Kustudić <strahinjak@nordeus.com>
2014-02-02 16:03   ` CS DBA <cs_dba@consistentstate.com>
2014-02-02 16:19 ` Raghavendra <raghavendra.rao@enterprisedb.com>
2014-02-02 16:26   ` CS DBA <cs_dba@consistentstate.com>
2014-02-02 16:32     ` Erik Darling <edarling80@gmail.com>
2014-02-02 17:11       ` deepak <deepak.05pal@gmail.com>
2014-02-02 16:51     ` Raghavendra <raghavendra.rao@enterprisedb.com>
2014-02-02 16:57       ` CS DBA <cs_dba@consistentstate.com>
2014-02-02 17:04         ` Raghavendra <raghavendra.rao@enterprisedb.com>
2014-02-02 17:08           ` CS DBA <cs_dba@consistentstate.com>
2014-02-02 17:19             ` Raghavendra <raghavendra.rao@enterprisedb.com>
2014-02-03 15:15         ` Luca Ferrari <fluca1978@infinito.it>
2014-02-03 15:20           ` Scott Ribe <scott_ribe@elevated-dev.com>
2014-02-03 15:21           ` Scott Ribe <scott_ribe@elevated-dev.com>
2014-02-02 17:03       ` Scott Ribe <scott_ribe@elevated-dev.com>
2014-02-02 17:06         ` Raghavendra <raghavendra.rao@enterprisedb.com>
2014-02-02 16:52     ` CS DBA <cs_dba@consistentstate.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox