Re: Deterministic locking in PostgreSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Hodges <robert(dot)hodges(at)continuent(dot)com>
Cc: "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Deterministic locking in PostgreSQL
Date: 2008-05-09 23:53:23
Message-ID: 8361.1210377203@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Hodges <robert(dot)hodges(at)continuent(dot)com> writes:
> This question may have an obvious answer I have somehow missed, but to what
> extent is locking order deterministic in PostgreSQL? For example, if
> requests from multiple transactions arrive in some deterministic order and
> acquire locks, can one assume that locks will be granted in the same order
> if the requests are repeated at different times or on different servers?

Yeah, it should be deterministic given consistent arrival order.

> Lock determinism is an important issue for replication algorithms that
> depend on database instances to behave as state machines.

However, the idea of depending on a replication algorithm that has race
conditions gives me the willies ... and that sure sounds like what you
are describing. Do not trust your data to the assumption that arrival
order will be deterministic.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-05-10 00:26:23 Re: gsoc08, text search selectivity, pg_statistics holding an array of a different type
Previous Message Tom Lane 2008-05-09 23:37:35 Re: [badalex@gmail.com: Re: [BUGS] Problem identifying constraints which should not be inherited]