theory of distributed transactions / timeouts - Mailing list pgsql-hackers

From Oliver Seidel
Subject theory of distributed transactions / timeouts
Date
Msg-id lfae5eb0y5.fsf@delta.imr-dvlp.de
Whole thread Raw
In response to AW: AW: timeout on lock feature  (Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>)
List pgsql-hackers
>>>>> "A Z" == Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:

PS: where can I find more on the distributed txn plans for PostgreSQL? Thanks.
   A Z> BTW: for distributed txns you need a lock timeout feature   A Z> anyway, because detecting remote deadlocks
betweentwo or   A Z> more different servers would be very complicated. And I do   A Z> think PostgreSQL will need
remotedb access a la long.
 

A typical distributed transaction management system would consist of

- a transaction manager for that particular transaction
- an associated log manager
- an optional associated lock manager (depending on transaction type: pessimistic, optimistic, etc)
- one or more resource managers (usually storage)

and thus the lock manager would have a single point of reference for
the existence of a transaction or not.  The "distributed" part in that
scenario would be that one {log|lock|resource} manager could be client
to several transaction managers simultaneously.  The problem of
deadlock detection is that of cyclic dependency-detection among
several transaction managers.  Pessimistic Transaction Managers do use
locks and understand their semantics, thus they can communicate with
their peers that are accessing the shared pool of locks.

I would agree that the simplest solution for deadlock detection is a
timeout, but it certainly is not the only one.

Most desirable would be a measure to choose which transaction to
abort, which simultaneously avoids starvation (no more cycles, ever
for txn X), upper limits (txns beyond X objects / locks / cycles /
... cannot happen), etc..  A timeout mechanism is not going to
approach this measure, but an analysis of the dependency matrix with
the associated information on resource usage of each transaction might
get close.

so long,

Oliver


pgsql-hackers by date:

Previous
From: Zeugswetter Andreas SB
Date:
Subject: AW: AW: timeout on lock feature
Next
From: "Mikheev, Vadim"
Date:
Subject: RE: AW: timeout on lock feature