pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: wangchuanting@huawei.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14680: startup process on standby encounter a deadlock of TwoPhaseStateLock when redo 2PC xlog
Date: Wed, 31 May 2017 03:32:28 +0000
Message-ID: <20170531033228.1487.10124@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      14680
Logged by:          chuanting  wang
Email address:      wangchuanting@huawei.com
PostgreSQL version: 10beta1
Operating system:   SuSE
Description:        

startup process on standby encounter a deadlock of TwoPhaseStateLock when
redo 2PC xlog.

the stack is:
Thread 6 (Thread 0x7f002e3ff700 (LWP 35305)):
#0  0x00007f1106167627 in semop () from /lib64/libc.so.6
#1  0x0000000000ce5622 in PGSemaphoreLock(PGSemaphoreData*, bool) ()
#2  0x0000000000d73e4d in LWLockAcquire(LWLockId, LWLockMode) ()
#3  0x0000000000969028 in RemoveGXact(GlobalTransactionData*) ()
#4  0x000000000096b254 in ProcessTwoPhaseBuffer(unsigned int, XLogRecPtr,
bool, bool, bool) ()
#5  0x000000000096b6b8 in PrescanPreparedTransactions(unsigned int**, int*)
()
#6  0x000000000097af97 in xlog_redo(XLogReaderState*) ()
#7  0x00000000009839df in StartupXLOG() ()
#8  0x0000000000cffd0b in StartupProcessMain() ()
#9  0x0000000000991539 in AuxiliaryProcessMain(int, char**) ()
#10 0x0000000000cfb209 in SubPostmasterMain(int, char**) ()
#11 0x0000000000cfb4f2 in MainStarterThreadFunc(void*) ()
#12 0x00007f11099a17b6 in start_thread () from /lib64/libpthread.so.0
#13 0x00007f1106165d6d in clone () from /lib64/libc.so.6
#14 0x0000000000000000 in ?? ()

the reason is:
when do PrescanPreparedTransactions, startup process already granted a
shared lock on TwoPhaseStateLock, then it called RemoveGXact, but in
RemoveGXact it acquired exclusive lock on TwoPhaseStateLock, so it blocked
by itself


anyone, has some idea on how to fix it?



-- 
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 (30+ messages)  latest in thread

Message-ID: <20170531033228.1487.10124@wrigleys.postgresql.org>
Permalink:  ../20170531033228.1487.10124@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170531033228.1487.10124@wrigleys.postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: wangchuanting@huawei.com
  Subject: Re: BUG #14680: startup process on standby encounter a deadlock of TwoPhaseStateLock when redo 2PC xlog
  In-Reply-To: <20170531033228.1487.10124@wrigleys.postgresql.org>

* 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