Re: serializable read only deferrable

Поиск
Список
Период
Сортировка
От Florian Pflug
Тема Re: serializable read only deferrable
Дата
Msg-id 94C154B6-0F9E-43B0-A245-1CFA8630064A@phlo.org
обсуждение исходный текст
Ответ на serializable read only deferrable  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: serializable read only deferrable  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
On Dec5, 2010, at 16:11 , Kevin Grittner wrote:
> The simple way to implement SERIALIZABLE READ ONLY DEFERRABLE under
> SSI would be to have each non-read-only serializable transaction
> acquire a heavyweight lock which can coexist with other locks at the
> same level (SHARE looks good) on some common object and hold that for
> the duration of the transaction, while a SERIALIZABLE READ ONLY
> DEFERRABLE transaction would need to acquire a conflicting lock
> (EXCLUSIVE looks good) before it could acquire a snapshot, and
> release the lock immediately after acquiring the snapshot.

Hm, so once a SERIALIZABLE READ ONLY DEFERRABLE is waiting to acquire the lock, no other transaction would be allowed
tostart until the SERIALIZABLE READ ONLY DEFERRABLE transaction has been able to acquire its snapshot. For pg_dump's
purposesat least, that seems undesirable, since a single long-running transaction at the time you start pg_dump would
effectlyDoS your system until the long-running transaction finishes. 

The alternative seems to be to drop the guarantee that a SERIALIZABLE READ ONLY DEFERRABLE won't be starved forever by
astream of overlapping non-READ ONLY transactions. Then a flag in the proc array that marks non-READ ONLY transactions
shouldbe sufficient, plus a wait-and-retry loop to take snapshots for SERIALIZABLE READ ONLY DEFERRABLE transactions. 

best regards,
Florian Pflug



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

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: pg_execute_from_file review
Следующее
От: marcin mank
Дата:
Сообщение: Re: WIP patch for parallel pg_dump