Re: Why is LockClassinfoForUpdate()'s mark4update a good idea?

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема Re: Why is LockClassinfoForUpdate()'s mark4update a good idea?
Дата
Msg-id 3A63BC55.28B5D7A3@tpf.co.jp
обсуждение исходный текст
Ответ на Why is LockClassinfoForUpdate()'s mark4update a good idea?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> 
> Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> > I like neither unexpected errors nor doing the wrong
> > thing by handling tuples which aren't guaranteed to
> > be up-to-date. After mark4update, the tuple is
> > guaranteed to be up-to-date and heap_update won't
> > fail even though some commands etc neglect to lock
> > the correspoding relation. Isn't it proper to guard
> > myself as much as possible ?
> 
> If one piece of the system "guards itself" and others do not, what have
> you gained?  Not much. 

??? The system guarding itself won't gain bad result at least.
If one piece of system "guards others" and others do not, both
may gain bad results. Locking a class info by locking the
corrsponding relation is such a mechanism.

However I don't think we could introduce this mechanism to all
system catalogs. I implemented LockClassinfoForUpdate()  by the
following reason.

1) pg_class is the most significant relation.
2) LockClassinfoForUpdate() adds few new conflicts   by locking the pg_class tuple because locking the  corresponding
relationlocks the pg_class entity  implicitly unless some stuff neglects to lock  corresponding relation.
 

Regards.
Hiroshi Inoue


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

Предыдущее
От: Lamar Owen
Дата:
Сообщение: 7.1beta3-2 RPMset uploading.
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: MS Access vs IS NULL (was Re: [BUGS] Bug in SQL functions that use a NULL parameter directly)