Re: Deterministic locking in PostgreSQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Deterministic locking in PostgreSQL
Date
Msg-id 8361.1210377203@sss.pgh.pa.us
Whole thread Raw
In response to Deterministic locking in PostgreSQL  (Robert Hodges <robert.hodges@continuent.com>)
Responses Re: Deterministic locking in PostgreSQL  (Robert Hodges <robert.hodges@continuent.com>)
List pgsql-hackers
Robert Hodges <robert.hodges@continuent.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] [badalex@gmail.com: Re: [BUGS] Problem identifying constraints which should not be inherited]
Next
From: Tom Lane
Date:
Subject: Re: gsoc08, text search selectivity, pg_statistics holding an array of a different type