Re: Exclusive lock for database rename

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: daveg <daveg(at)sonic(dot)net>
Cc: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>, Jochem van Dieten <jochemd(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Exclusive lock for database rename
Date: 2005-11-09 08:41:49
Message-ID: 20051109084143.GA21585@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 08, 2005 at 04:06:32PM -0800, daveg wrote:
> I think this wait with an exponentially rising delay hurts not helps. If the
> stricter lock can be granted in a short time, ie the dalay could be small,
> then there is no problem. If the lock cannot be granted and the delay expires
> the stricter lock has incurred extra wait time already and allowed newer
> conflicting requests ahead of it possibly increasing the total wait time.
> As the timeout increases newer requests end up waiting for the new longer
> time anyway so the overall effect is to increase all lockers total wait time.

But I don't see an alternative. Group A needs access to the resource,
Group B (the rename) needs exclusive access. If you don't start holding
off the members of group A, the rename will never complete.

If you keep doing say 30 second waits, then any regular queries that
take longer than that can block you out forever. The only way to
eventually win is to eventually have a timeout longer than the longest
currently running query.

Anyway, this is theoretical as the code for this doesn't exist. It was
just an idea.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message daveg 2005-11-09 08:50:18 Re: Exclusive lock for database rename
Previous Message Adrian Maier 2005-11-09 08:22:49 Re: compiling on windows with mingw