Re: Block level concurrency during recovery

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Block level concurrency during recovery
Дата
Msg-id 49001534.6070001@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Block level concurrency during recovery  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: Block level concurrency during recovery  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
Simon Riggs wrote:
> I'm undecided as to whether this is too much code or too little. I'm
> somewhat uncertain as to the locking requirements for the physical scan
> during a vacuum. I've worked out various options if we need to change
> this.

For the B-tree, an exclusive lock is enough to modify the contents of 
the page. A cleanup lock needs to be taken on every page to ensure that 
the vacuum doesn't finish and delete a heap tuple that's about to be 
accessed by an index scan. That could be handled in WAL replay by 
dropping the exclusive lock and re-acquiring the cleanup lock, but we 
can't do that for heap vacuums.

However, we require that in b-tree vacuum, you take a cleanup lock on 
*every* leaf page of the index, not only those that you modify. That's a 
problem, because there's no trace of such pages in the WAL.

PS. FSM doesn't need cleanup locks.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Deriving Recovery Snapshots
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Making pg_standby compression-friendly