Search Postgresql Archives

Re: two phase commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2007-07-19 at 15:13 -0700, Ben wrote:
> I'm reading the description of PREPARE TRANSACTION, and I see this:
> 
> "...its state is fully stored on disk, and there is a very high 
> probability that it can be committed successfully..."
> 
> What corner case reduces 2pc from "guaranteed" to "very high probability"? 
> Is the worry if somebody leaves transactions in a prepared state for 
> weeks, only to find that deadlock issues has arrisen at final commit time?
> 

You won't get a deadlock on COMMIT, because COMMIT doesn't acquire more
locks. 

The failure cases for a 2PC transaction are (as I understand it)
catastrophic. That means either the transaction can be committed, or you
probably need to restore onto new hardware anyway.

2PC is useful when multiple databases are involved and your application
crashes. When the application comes back you can look at the prepared
transactions and decide whether to COMMIT PREPARED or ROLLBACK PREPARED
based on the information in the other databases involved.

	Regards,
		Jeff Davis



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux