Re: 2-phase commit

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, "'Zeugswetter Andreas SB SD'" <ZeugswetterA(at)spardat(dot)at>, "'Andrew Sullivan'" <andrew(at)libertyrms(dot)info>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 2-phase commit
Date: 2003-09-29 14:13:18
Message-ID: 200309291413.h8TEDIc11345@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> > [At participant(master)'s side]
> > Because the commit operations is done, does nothing.
>
> > [At coordinator(slave)' side]
> > 1) After a while
> > 2) re-establish the communication path between the
> > partcipant(master)'s TM.
> > 3) resend the "commit requeset" to the participant's TM.
> > 1)2)3) would be repeated until the coordinator receives
> > the "commit ok" message from the partcipant.
>
> [ scratches head ] I think you are using the terms "master" and "slave"
> oppositely than I would. But in any case, this is not an answer to the
> concern I had. You're assuming that the "coordinator(slave)" side is
> willing to resend a request indefinitely, and also that the
> "participant(master)" side is willing to retain per-transaction commit
> state indefinitely so that it can correctly answer belated questions
> from the other side. What I was complaining about was that I don't
> think either side can afford to remember per-transaction state
> indefinitely. 2PC in the abstract is a useless academic abstraction ---
> where the rubber meets the road is defining how you cope with failures
> in the commit protocol.

I don't think there is any way to handle cases where the master or slave
just disappears. The other machine isn't under the server's control, so
it has no way of it knowing. I think we have to allow the administrator
to set a timeout, or ask to wait indefinately, and allow them to call an
external program to record the event or notify administrators.
Multi-master replication has the same issues.

My original point was that multi-master replication has the same
limitations, but people still want it. Same for two-phase commit --- it
has the same limitations, but people want it.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2003-09-29 14:14:30 Re: 2-phase commit
Previous Message Christopher Browne 2003-09-29 14:13:11 Re: initdb failure