pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: enzesheng <enzesheng@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #11025: could not access status of transaction 7
Date: Thu, 24 Jul 2014 17:51:50 -0700 (PDT)
Message-ID: <1406249509455-5812796.post@n5.nabble.com> (raw)
In-Reply-To: <20140724165415.GH5475@eldon.alvh.no-ip.org>
References: <20140723072420.27765.68794@wrigleys.postgresql.org>
	<27346.1406148531@sss.pgh.pa.us>
	<20140724165415.GH5475@eldon.alvh.no-ip.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Sorry, I didn't put the code clearly.
I modified the pgstat_heap function, the SnapshotNow is changed to
HeapTupleSatisfiesMVCCCMDChkDB which is wrote by me.
Stack information and code
#0  SimpleLruReadPage (ctl=0x8464c60, pageno=43890, write_ok=1 '\001',
xid=1438198033) at slru.c:374
#1  0x080e8e4c in SimpleLruReadPage_ReadOnly (ctl=0x8464c60, pageno=43890,
xid=1438198033) at slru.c:494
#2  0x080c7d69 in TransactionIdGetStatus (xid=1, lsn=0xbfb59c7c) at
clog.c:184
#3  0x080c7f5f in TransactionLogFetch (transactionId=1438198033) at
transam.c:82
#4  0x080c8101 in TransactionIdDidCommit (transactionId=1438198033) at
transam.c:172
#5  0x0835997d in HeapTupleSatisfiesMVCCCMDChkDB (tuple=0xb10d6688,
snapshot=0x8461740, buffer=128176) at tqual.c:1481
#6  0x0831d689 in pgstat_heap (rel=0x6dbbffe0, fcinfo=0xbfb59f80) at
pgstattuple.c:671
#7  0x0831f257 in pgstattuplebyid (fcinfo=0xbfb59f80) at pgstattuple.c:583

pgstat_heap 
        /* Disable syncscan because we assume we scan from block zero
upwards */
		scan = heap_beginscan_strat(rel, SnapshotAny, 0, NULL, true, false);

		*nblocks = scan->rs_nblocks; /* # blocks to be scanned */

		/* scan the relation */
		while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
		{
			/* must hold a buffer lock to call HeapTupleSatisfiesVisibility */
			LockBuffer(scan->rs_cbuf, BUFFER_LOCK_SHARE);
			if (HeapTupleSatisfiesVisibility(tuple, SnapshotNow, scan->rs_cbuf))
			{
				stat.tuple_len += tuple->t_len;
				stat.tuple_count++;
			}
			
HeapTupleSatisfiesMVCCCMDChkDB
bool HeapTupleSatisfiesMVCCCMDChkDB(HeapTupleHeader tuple, Snapshot
snapshot,
					   Buffer buffer)
{
    TransactionId   xmin        = InvalidTransactionId;
    TransactionId   xmax        = InvalidTransactionId;
    bool            xminCommit  = false;
    bool            xmaxCommit  = false;
    bool            xminInvalid  = false;
    bool            xmaxInvalid  = false;

    volatile BufferDesc *bufHdr = NULL;
    
    xmin = HeapTupleHeaderGetXmin(tuple);
    xmax = HeapTupleHeaderGetXmax(tuple);

    if (InvalidTransactionId == xmin)
    {
         xminInvalid = true;
    }
    else
    {
         xminCommit = TransactionIdDidCommit(xmin);
    }

    if (InvalidTransactionId == xmax)
    {
         xmaxInvalid = true;
    }
    else
    {
         xmaxCommit = TransactionIdDidCommit(xmax);
    }



--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11025-could-not-access-status-of-transaction-7-tp5812611...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)

Message-ID: <1406249509455-5812796.post@n5.nabble.com>
Permalink:  ../1406249509455-5812796.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1406249509455-5812796.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: enzesheng@gmail.com
  Subject: Re: BUG #11025: could not access status of transaction 7
  In-Reply-To: <1406249509455-5812796.post@n5.nabble.com>
  References: <20140723072420.27765.68794@wrigleys.postgresql.org> <27346.1406148531@sss.pgh.pa.us> <20140724165415.GH5475@eldon.alvh.no-ip.org> <1406249509455-5812796.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox