pg_ctl -D "/absolute/path" -m fast restart - doesn't work in some cases

Started by hubert depesz lubaczewskialmost 13 years ago7 messagesbugs
Jump to latest

hi,
I have 9.3beta1, and strange problem.

Have running slave pg in directory /home/test/test/slave:

=$ pwd
/home/test/test/slave

=$ cat postmaster.pid
16961
/home/test/test/slave
1368736261
5433
/tmp
*
5433001 7241781

=$ ps uxf
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
...
test 16961 0.2 0.1 173528 12912 pts/7 S 22:31 0:00 /home/pgdba/work/bin/postgres -D test/slave
test 16970 0.0 0.0 27020 812 ? Ss 22:31 0:00 \_ postgres: logger process
test 16971 4.0 0.0 173640 5724 ? Ss 22:31 0:00 \_ postgres: startup process recovering 00000001000000000000001B
test 17008 0.0 0.0 173528 972 ? Ss 22:31 0:00 \_ postgres: checkpointer process
test 17009 0.0 0.0 173528 1244 ? Ss 22:31 0:00 \_ postgres: writer process
test 17028 0.0 0.0 29116 888 ? Ss 22:31 0:00 \_ postgres: stats collector process
test 17029 2.8 0.0 190652 4232 ? Ds 22:31 0:00 \_ postgres: wal receiver process streaming 0/1B7917E0
...

All looks fine. But when I'll try to restart it:

=$ pg_ctl -D $( pwd ) -m fast restart
waiting for server to shut down.... done
server stopped
server starting
postgres cannot access the server configuration file "/home/test/test/slave/test/slave/postgresql.conf": No such file or directory

The problem doesn't exist when I'd start pg with:
1. cd test/slave; pg_ctl -D . start
or
2. pg_ctl -D /home/test/test/slave start

only when Pg is started with relative path, and restarted with absolute, the
problem shows.

I know that it's probably not a big deal for most of the people, but it
did bite me, so I'm reporting it.

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
http://depesz.com/

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

#2Josh Kupershmidt
schmiddy@gmail.com
In reply to: hubert depesz lubaczewski (#1)
Re: pg_ctl -D "/absolute/path" -m fast restart - doesn't work in some cases

On Thu, May 16, 2013 at 4:34 PM, hubert depesz lubaczewski
<depesz@depesz.com> wrote:

=$ pg_ctl -D $( pwd ) -m fast restart
waiting for server to shut down.... done
server stopped
server starting
postgres cannot access the server configuration file "/home/test/test/slave/test/slave/postgresql.conf": No such file or directory

The problem doesn't exist when I'd start pg with:
1. cd test/slave; pg_ctl -D . start
or
2. pg_ctl -D /home/test/test/slave start

only when Pg is started with relative path, and restarted with absolute, the
problem shows.

I know that it's probably not a big deal for most of the people, but it
did bite me, so I'm reporting it.

It has been a nuisance for me too. Possible patch for pg_ctl is in the next CF:
/messages/by-id/CAK3UJRFK8-izAU1SMpNZr5Muc+6CRWBk0_7ByJnwUoapj3esFQ@mail.gmail.com

Josh

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

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Josh Kupershmidt (#2)
Re: pg_ctl -D "/absolute/path" -m fast restart - doesn't work in some cases

Josh Kupershmidt escribió:

On Thu, May 16, 2013 at 4:34 PM, hubert depesz lubaczewski
<depesz@depesz.com> wrote:

only when Pg is started with relative path, and restarted with absolute, the
problem shows.

It has been a nuisance for me too. Possible patch for pg_ctl is in the next CF:
/messages/by-id/CAK3UJRFK8-izAU1SMpNZr5Muc+6CRWBk0_7ByJnwUoapj3esFQ@mail.gmail.com

Um, if this is a bug introduced during the 9.3 timeframe surely we
ought to fix it now instead of waiting for the CF.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

In reply to: Alvaro Herrera (#3)
Re: pg_ctl -D "/absolute/path" -m fast restart - doesn't work in some cases

On czw, maj 16, 2013 at 05:55:54 -0400, Alvaro Herrera wrote:

only when Pg is started with relative path, and restarted with absolute, the
problem shows.

It has been a nuisance for me too. Possible patch for pg_ctl is in the next CF:
/messages/by-id/CAK3UJRFK8-izAU1SMpNZr5Muc+6CRWBk0_7ByJnwUoapj3esFQ@mail.gmail.com

Um, if this is a bug introduced during the 9.3 timeframe surely we
ought to fix it now instead of waiting for the CF.

Apparently not. Retried with 9.1.9, and got exactly same result:

=$ pg_ctl -D q -l logfile start
server starting

=$ cd q

=$ pg_ctl -D $( pwd ) -m fast restart
waiting for server to shut down.... done
server stopped
server starting
postgres cannot access the server configuration file "/home/depesz/q/q/postgresql.conf": No such file or directory

Best regards,

depesz

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

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#3)
Re: pg_ctl -D "/absolute/path" -m fast restart - doesn't work in some cases

Alvaro Herrera <alvherre@2ndquadrant.com> writes:

Um, if this is a bug introduced during the 9.3 timeframe surely we
ought to fix it now instead of waiting for the CF.

I think it's been that way all along. Nonetheless, if you feel
motivated to review the patch now, there's nothing wrong with that.

regards, tom lane

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

#6Boszormenyi Zoltan
zb@cybertec.at
In reply to: Alvaro Herrera (#3)
Bugfix patches in the next CF, was: Re: pg_ctl -D "/absolute/path" -m fast restart - doesn't work in some cases

2013-05-16 23:55 keltezéssel, Alvaro Herrera írta:

Josh Kupershmidt escribió:

On Thu, May 16, 2013 at 4:34 PM, hubert depesz lubaczewski
<depesz@depesz.com> wrote:

only when Pg is started with relative path, and restarted with absolute, the
problem shows.

It has been a nuisance for me too. Possible patch for pg_ctl is in the next CF:
/messages/by-id/CAK3UJRFK8-izAU1SMpNZr5Muc+6CRWBk0_7ByJnwUoapj3esFQ@mail.gmail.com

Um, if this is a bug introduced during the 9.3 timeframe surely we
ought to fix it now instead of waiting for the CF.

Sorry for diverting the thread but if bugfixes are urgent, you can also look at
/messages/by-id/CABUevEwx2DQT45x1pHHdzD_khy8HZ5A9Xo95XVGHou2ZTyNx2A@mail.gmail.com
and the fix at https://commitfest.postgresql.org/action/patch_view?id=1085
The CF in progress at the time was already closed for new patches.

There are other patches marked as a bugfix, like:
https://commitfest.postgresql.org/action/patch_view?id=1087
https://commitfest.postgresql.org/action/patch_view?id=1076
https://commitfest.postgresql.org/action/patch_view?id=1081

Best regards,
Zoltán Böszörményi

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/

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

#7Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Boszormenyi Zoltan (#6)
Re: Bugfix patches in the next CF, was: Re: pg_ctl -D "/absolute/path" -m fast restart - doesn't work in some cases

On 17.05.2013 11:57, Boszormenyi Zoltan wrote:

Sorry for diverting the thread but if bugfixes are urgent, you can also
look at
/messages/by-id/CABUevEwx2DQT45x1pHHdzD_khy8HZ5A9Xo95XVGHou2ZTyNx2A@mail.gmail.com

and the fix at https://commitfest.postgresql.org/action/patch_view?id=1085
The CF in progress at the time was already closed for new patches.

[pg_basebackup with -R option and start standby have problems with
escaped password]

I replied to that now. Let's get that fixed before next beta.

There are other patches marked as a bugfix, like:
https://commitfest.postgresql.org/action/patch_view?id=1087

[backend hangs at immediate shutdown]

The question here is do we want to take the risk and apply this, at this
late stage? On a cursory look, I understand it well enough to have an
opinion.

https://commitfest.postgresql.org/action/patch_view?id=1076

[fixing pg_ctl with relative paths]

Seems reasonable, and I think we should apply this now, to 9.3. The
issue with embedded quotes is pretty scary though, maybe we should dig a
bit deeper into that to get that fixed too.

https://commitfest.postgresql.org/action/patch_view?id=1081

I don't know ldap well enough to comment, but I think we should fix this
now, in 9.3, if we want to do this at all.

- Heikki

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