Re: userlock changes for 8.1/8.2

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: userlock changes for 8.1/8.2
Дата
Msg-id 5993.1106680152@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: userlock changes for 8.1/8.2  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
Список pgsql-hackers
"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:
> Ok, you answered my next question.  Part of my confusion here is the
> comments in front of LockAcquire() which explains how userlocks are
> supposed to be mapped to the lock tag.  In the case of userlocks, the
> locktag is basically a hash key, right?

Those are just comments ;-).  You have a hash tag and you can do
anything you like with it ... except make it bigger ... the lockmethod
field is sufficient to keep it from colliding with any system-generated
tags.

> ctid is useless for user locks because an update from a non-cooperating
> client will change it unless the locks become non-cooperative,

[ shrug... ]  Since userlocks are only advisory, a non-cooperating
client can break anything in sight anyway.  I don't find the above
argument convincing.  But in any case, you can use an OID or serial
sequence identifier if you prefer that to CTID.  They're just integers
and it's really up to the user application to define the interpretation
of a userlock tag.

> IOW, a 'user lock' candidate identifier generated by the database
> must be both unique and persistent for the lifetime of the lock.

See above.  The database isn't defining anything here.
        regards, tom lane


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

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: Heads up: upcoming releases in all branches back to
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: userlock changes for 8.1/8.2