Re: Question concerning XTM (eXtensible Transaction Manager API)

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Question concerning XTM (eXtensible Transaction Manager API)
Date: 2015-11-16 20:12:57
Message-ID: 564A38C9.8020205@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/16/2015 10:54 PM, Alvaro Herrera wrote:
> Konstantin Knizhnik wrote:
>
>> But you may notice that original TransactionIdSetTreeStatus function is void
>> - it is not intended to return anything.
>> It is called in RecordTransactionCommit in critical section where it is not
>> expected that commit may fail.
>> But in case of DTM transaction may be rejected by arbiter. XTM API allows to
>> control access to CLOG, so everybody will see that transaction is aborted.
>> But we in any case have to somehow notify client about abort of transaction.
> I think you'll need to rethink how a transaction commits rather
> completely, rather than consider localized tweaks to specific functions.
> For one thing, the WAL record about transaction commit has already been
> written by XactLogCommitRecord much earlier than calling
> TransactionIdCommitTree. So if you were to crash at that point, it
> doesn't matter how much the arbiter has rejected the transaction, WAL
> replay would mark it as committed.

Yes, WAL replay will recover this transaction and try to mark it in CLOG as completed, but ... we have caught control over CLOG using XTM.
And instead of direct writing to CLOG, DTM will contact arbiter and ask his opinion concerning this transaction.
If arbiter doesn't think that it was committed, then it will not be marked as committed in local CLOG.

> Also, what about the replication
> origin stuff and the TransactionTreeSetCommitTsData() call?
>
> I think you need to involve the arbiter earlier, so that the commit
> process can be aborted earlier than those things.
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-11-16 20:13:23 Re: Proposal: "Causal reads" mode for load balancing reads without stale data
Previous Message Robert Haas 2015-11-16 19:59:42 Re: Parallel Seq Scan