Re: Stuck spins in current
От | Tom Lane |
---|---|
Тема | Re: Stuck spins in current |
Дата | |
Msg-id | 849.984884831@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | RE: Stuck spins in current ("Mikheev, Vadim" <vmikheev@SECTORBASE.COM>) |
Список | pgsql-hackers |
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM> writes: > And you know - I've run same tests on ~ Mar 9 snapshot > without any problems. Oh, I see it: Process A is doing GetSnapShotData. It holds SInvalLock and calls ReadNewTransactionId, which wants XidGenLockId. Process B is doing GetNewTransactionId. It holds XidGenLockId and has run out of XIDs, so it needs to write a NEXTXID log record. Therefore, it calls XLogInsert which wants the insert_lck. Process C is inside XLogInsert on its first xlog entry of a transaction. It holds the insert_lck and wants to put its XID into MyProc->logRec, for which it needs SInvalLock. Ooops. At this point I must humbly say "yes, you told me so", because if I hadn't insisted that we needed NEXTXID records then we wouldn't have this deadlock. It looks to me like the simplest answer is to take NEXTXID records out again. (Fortunately, there doesn't seem to be any comparable cycle involving OidGenLock, or we'd need to think of a better answer.) I shall retire to lick my wounds, and make the changes tomorrow ... regards, tom lane
В списке pgsql-hackers по дате отправления: