Re: [HACKERS] Early locking option to parallel backup - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Early locking option to parallel backup
Date
Msg-id 14976.1509939814@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Early locking option to parallel backup  (Andres Freund <andres@anarazel.de>)
Responses Re: [HACKERS] Early locking option to parallel backup  (Robert Haas <robertmhaas@gmail.com>)
Re: [HACKERS] Early locking option to parallel backup  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> Well, the current approach afaics requires #relations * 2 locks, whereas
> acquiring them in every worker would scale that with the number of
> workers.

Yeah, that's gonna be a problem with this proposal.

> IIUC the problem here is that even though a lock is already
> held by the main backend an independent locker's request will prevent
> the on-demand lock by the dump worker from being granted.  It seems to
> me the correct fix here would be to somehow avoid the fairness logic in
> the parallel dump case - although I don't quite know how to best do so.

I wonder if we couldn't somehow repurpose the work that was done for
parallel workers' locks.  Lots of security-type issues to be handled
if we're to open that up to clients, but maybe it's solvable.  For
instance, maybe only allowing it to clients sharing the same snapshot
would help.
        regards, tom lane


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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] why not parallel seq scan for slow functions
Next
From: David Rowley
Date:
Subject: Re: [HACKERS] path toward faster partition pruning