Thread: deadlock_timeout and pg_ctl reload

deadlock_timeout and pg_ctl reload

From
"A.Bhuvaneswaran"
Date:
Hi,

I am using pgsql 7.3.2.

If we change the deadlock_timeout value in postgresql.conf and say pg_ctl
reload, the new value is not taken affect. But any other changes like,
datestyle, log_connection, log_pid, etc are taken affect immediately when
we say pg_ctl reload. When we restart the server, the changed
deadlock_timeout value is taken affect.

Example:

1. In 2 psqls, run the deadlock test case. Deadlock is detected in 1sec.
2. Set deadlock_timeout = 15000 and reload the server.
3. Repeat step 1, deadlock is detected again in 1 sec.
4. Restart the server and repeat step 1, deadlock is detected in around
   15secs.

regards,
bhuvaneswaran

Re: deadlock_timeout and pg_ctl reload

From
Stephan Szabo
Date:
On Mon, 21 Jul 2003, A.Bhuvaneswaran wrote:

> I am using pgsql 7.3.2.
>
> If we change the deadlock_timeout value in postgresql.conf and say pg_ctl
> reload, the new value is not taken affect. But any other changes like,
> datestyle, log_connection, log_pid, etc are taken affect immediately when
> we say pg_ctl reload. When we restart the server, the changed
> deadlock_timeout value is taken affect.

It looks like deadlock_timeout is set PGC_POSTMASTER so it's not
supposed to be reread on SIGHUP (reload) but only on postmaster start.

Re: deadlock_timeout and pg_ctl reload

From
Bruce Momjian
Date:
Stephan Szabo wrote:
>
> On Mon, 21 Jul 2003, A.Bhuvaneswaran wrote:
>
> > I am using pgsql 7.3.2.
> >
> > If we change the deadlock_timeout value in postgresql.conf and say pg_ctl
> > reload, the new value is not taken affect. But any other changes like,
> > datestyle, log_connection, log_pid, etc are taken affect immediately when
> > we say pg_ctl reload. When we restart the server, the changed
> > deadlock_timeout value is taken affect.
>
> It looks like deadlock_timeout is set PGC_POSTMASTER so it's not
> supposed to be reread on SIGHUP (reload) but only on postmaster start.

I think it doesn't reload because we want to have the same timeouts for
all backends, and reload doesn't happen at the same instant for all
backend. A restart would get the new values, or should.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: deadlock_timeout and pg_ctl reload

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Stephan Szabo wrote:
>> It looks like deadlock_timeout is set PGC_POSTMASTER so it's not
>> supposed to be reread on SIGHUP (reload) but only on postmaster start.

> I think it doesn't reload because we want to have the same timeouts for
> all backends, and reload doesn't happen at the same instant for all
> backend.

Yeah, I've forgotten the details, but I'm pretty sure we were worried
about race conditions or missed timeouts of some sort if we allowed
deadlock_timeout to change on-the-fly.  Try digging in the archives
if you want the whole scoop.

            regards, tom lane