Re: Hot Standby and prepared transactions - Mailing list pgsql-hackers

From Hiroyuki Yamada
Subject Re: Hot Standby and prepared transactions
Date
Msg-id 200912171055.AA00174@silver.kokolink.net
Whole thread Raw
In response to Re: Hot Standby and prepared transactions  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Hot Standby and prepared transactions  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: Hot Standby and prepared transactions  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
>On Wed, 2009-12-16 at 19:35 +0900, Hiroyuki Yamada wrote:
>
>>  * There is a window beween gathering lock information in GetRunningTransactionLocks()
>>    and writing WAL in LogAccessExclusiveLocks().
>>  * In current lock redo algorithm, locks are released when the transaction holding the lock
>>    are commited or aborted.
>> 
>> ... then what happens if any transaction holding ACCESS EXCLUSIVE lock commits in the 
>>    window ?
>
>Yes, was a problem in that code. Fixed in git.
>
>We were doing it for prepared transactions but not for normal xacts.
>I will look again at that code.
>
>Thanks very much for reading the code. Any more?!?
>

Well, I've read some more and have a question.

The implementation assumes that transactions write COMMIT/ABORT WAL at the end
of them, while it does not seem to write ABORT WAL in immediate shutdown. So,

1. acquire ACCESS EXCLUSIVE lock in table A in xact 1
2. execute immediate shutdown of the active node
3. restart it
4. acquire ACCESS EXCLUSIVE lock in table A in xact 2

...then, duplicate lock acquisition by two diffrent transactions can occur in the standby node.

Am I missing something ? Or is this already reported ?


regards,

-- Hiroyuki YAMADA Kokolink Corporation yamada@kokolink.net


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: PATCH: Spurious "22" in hstore.sgml
Next
From: Heikki Linnakangas
Date:
Subject: Re: Hot Standby and prepared transactions