Re: parallel pg_restore - WIP patch

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: parallel pg_restore - WIP patch
Дата
Msg-id 48E0CADF.8000009@dunslane.net
обсуждение исходный текст
Ответ на Re: parallel pg_restore - WIP patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: parallel pg_restore - WIP patch
Список pgsql-hackers

Tom Lane wrote:
> Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:
>   
>> pg_restore: [archiver (db)] could not execute query: ERROR:  deadlock 
>> detected
>> DETAIL:  Process 18100 waits for AccessExclusiveLock on relation 
>> 1460818342 of database 1460815284; blocked by process 18103.
>> Process 18103 waits for AccessExclusiveLock on relation 1460818336 of 
>> database 1460815284; blocked by process 18100.
>> HINT:  See server log for query details.
>>     
>
>   
>> ALTER TABLE ONLY foo
>>      ADD CONSTRAINT fk_av_relations_av FOREIGN KEY (vs_id) REFERENCES 
>> bar ...
>>     
>
> Hmm, I'll bet the restore code doesn't realize that this can't run in
> parallel with index creation on either table ...
>
>             
>   

Yeah. Of course, it's never needed to bother with stuff like that till now.

The very simple fix is probably to run a separate parallel cycle just 
for FKs, after the index creation.

A slightly more elegant fix would probably be to add dependencies from 
each index that might cause this to the FK constraint.

I'll work on the first for now.

Is there any chance that the locks we're taking here are too strong? 
Intuitively it looks a bit like it.

cheers

andrew


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: [PATCHES] Infrastructure changes for recovery
Следующее
От: Tom Lane
Дата:
Сообщение: Re: parallel pg_restore - WIP patch