Re: does tuple store subtransaction id in it?

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Xiaoyulei <xiaoyulei(at)huawei(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: does tuple store subtransaction id in it?
Date: 2015-06-17 02:35:14
Message-ID: CAJrrPGc8BVYaDu+PBMaP4KuN13hJ6GncRc0s2jh0z55yGaM4DA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 16, 2015 at 1:08 PM, Xiaoyulei <xiaoyulei(at)huawei(dot)com> wrote:
> In XidInMVCCSnapshot, it will check xid from tuple if is in snapshot->subxip. It means tuple store subtransaction?

Tuple stores only the transaction id related to the operation. This
can be either main transaction id or sub transaction id.

> But in PushTransaction, I see TransactionState.subTransaction will assign currentSubTransactionId, currentSubTransactionId will reinitialize in StartTransaction. So I think tuple should not store subtransaction id.
>
> I am confuse about this. If subtransaction id will reinitialize every start time. How to judge it is a subtransaction from xid in tuple?

StartTransaction is called only once per transaction.Further on for
sub transactions it calls only startSubTransaction.
Hope this answers your question.

Regards,
Hari Babu
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Prakash Itnal 2015-06-17 04:17:27 Re: Auto-vacuum is not running in 9.1.12
Previous Message Thomas Munro 2015-06-16 21:41:32 Re: 9.4.1 -> 9.4.2 problem: could not access status of transaction 1