Deadlock detection - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Deadlock detection
Date
Msg-id 20030519010252.GE3325@dcc.uchile.cl
Whole thread Raw
Responses Re: Deadlock detection
List pgsql-hackers
Hackers,

I've been briefly looking at the deadlock detection code to see what's
needed to support nested transactions.

It seems the only way to run the deadlock detection
(storage/lmgr/deadlock.c:DeadLockCheck()) is through
storage/lmgr/proc.c:CheckDeadLock(), and it's only called with MyProc as
argument.  AFAIU this means that the only transaction that can be
aborted is the transaction that's trying to acquire the lock.

If this is so, then it's obvious that there can't be subtransactions in
progress of the transaction that's going to be aborted.  This means that
there's no need for a mechanism to abort a transaction and all its
subtransactions, because they are all finished if there are any at all.

Am I right on this?

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"El dia que dejes de cambiar dejaras de vivir"


pgsql-hackers by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Feature suggestions (long)
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Feature suggestions (long)