Re: Idea for fixing parallel pg_dump's lock acquisition problem

2019-04-19 Thread Tom Lane
Julien Rouhaud writes: > On Fri, Apr 19, 2019 at 7:17 PM Tom Lane wrote: >> My thought was that we'd like this to work without requiring any new >> server-side facilities, so that pg_dump could use it against any server >> version that supports parallel dump. > Couldn't we use LOCKTAG_USERLOCK f

Re: Idea for fixing parallel pg_dump's lock acquisition problem

2019-04-19 Thread Julien Rouhaud
On Fri, Apr 19, 2019 at 7:17 PM Tom Lane wrote: > > Robert Haas writes: > > On Wed, Apr 17, 2019 at 11:34 AM Tom Lane wrote: > >> ... If there are user applications > >> running that also use advisory locks, there could be unwanted > >> interference. One easy improvement is to use pg_try_adviso

Re: Idea for fixing parallel pg_dump's lock acquisition problem

2019-04-19 Thread Tom Lane
Robert Haas writes: > On Wed, Apr 17, 2019 at 11:34 AM Tom Lane wrote: >> ... If there are user applications >> running that also use advisory locks, there could be unwanted >> interference. One easy improvement is to use pg_try_advisory_lock(k) in >> step 2, and just choose a different k if the

Re: Idea for fixing parallel pg_dump's lock acquisition problem

2019-04-19 Thread Robert Haas
On Wed, Apr 17, 2019 at 11:34 AM Tom Lane wrote: > While thinking about that, it occurred to me that we could close the > gap if the server somehow understood that the master was waiting for > the worker. And it's actually not that hard to make that happen: > we could use advisory locks. Conside