Re: raise ERROR between EndPrepare and PostPrepare_Locks causes ROLLBACK 2pc PAINC
| От | Andy Fan |
|---|---|
| Тема | Re: raise ERROR between EndPrepare and PostPrepare_Locks causes ROLLBACK 2pc PAINC |
| Дата | |
| Msg-id | 87h5q468us.fsf@163.com обсуждение исходный текст |
| Ответ на | raise ERROR between EndPrepare and PostPrepare_Locks causes ROLLBACK 2pc PAINC (Andy Fan <zhihuifan1213@163.com>) |
| Ответы |
Re: raise ERROR between EndPrepare and PostPrepare_Locks causes ROLLBACK 2pc PAINC
|
| Список | pgsql-hackers |
Andy Fan <zhihuifan1213@163.com> writes: > Hi, > > With the following hack in PrepareTransaction: > > @@ -2697,6 +2697,8 @@ PrepareTransaction(void) > */ > EndPrepare(gxact); > > + elog(ERROR, "some error"); > + > /* > * Now we clean up backend-internal state and release internal resources. > */ > > Then we can do the following test: > CREATE TABLE t(a int); > begin; > insert into t values(1); > prepare transaction 'foo'; > ERROR: some error. // before the lock transfer > rollback prepared 'foo'; > PANIC: failed to re-find shared lock object // because lock is released > when ERROR. I found a similar but not exactly same case at 2014 [1] which might be helpful to recall a boarder understanding on this area. [1] https://www.postgresql.org/message-id/534AF601.1030007%40vmware.com -- Best Regards Andy Fan
В списке pgsql-hackers по дате отправления: