答复: questions about concurrency control in Postgresql

From: 黄晓骋 <huangxclife(at)gmail(dot)com>
To: "'Greg Stark'" <gsstark(at)mit(dot)edu>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: 答复: questions about concurrency control in Postgresql
Date: 2009-12-09 07:33:44
Message-ID: 002101ca78a1$f2e433f0$d8ac9bd0$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>It's a two step process. An update marks the tuple locked. Another
>transaction which comes along and wants to lock the tuple waits on the
>transaction marked on the tuple. When the first transaction commits or
>aborts then the second transaction can proceed and lock the tuple
>itself.
I agree with it.

>The reason we need both locks is because the first transaction
>cannot go around the whole database finding every tuple it ever locked
>to unlock it, firstly that could be a very large list and secondly
>there would be no way to do that atomically.

You mean that 2PL is hard to realize actually, I agree too.
But it doesn't mean tuple lock is necessary.

>Tuple locks and all user-visible locks are indeed held until the end
>of the transaction.
I don't agree with it, for I see unlocktuple(...) in heap_update(...).

--Huang Xiaocheng
--Database & Information System Lab, Nankai University

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4671 (20091208) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2009-12-09 07:55:41 Re: Streaming replication and non-blocking I/O
Previous Message Jaime Casanova 2009-12-09 07:04:16 Re: XLogInsert