Re: Race condition in TransactionIdIsInProgress
От | Robert Haas |
---|---|
Тема | Re: Race condition in TransactionIdIsInProgress |
Дата | |
Msg-id | CA+TgmoaTUg8B-hfj5N212yyb2GMxr2-4sZ=x_tKfui551NxOTw@mail.gmail.com обсуждение исходный текст |
Ответ на | Race condition in TransactionIdIsInProgress (Konstantin Knizhnik <knizhnik@garret.ru>) |
Ответы |
Re: Race condition in TransactionIdIsInProgress
|
Список | pgsql-hackers |
On Thu, Feb 10, 2022 at 11:46 AM Konstantin Knizhnik <knizhnik@garret.ru> wrote: > Postgres first records state transaction in CLOG, then removes > transaction from procarray and finally releases locks. > But it can happen that transaction is marked as committed in CLOG, > XMAX_COMMITTED bit is set in modified tuple but > TransactionIdIsInProgress still returns true. As a result "t_xmin %u is > uncommitted in tuple (%u,%u) to be updated in table" > error is reported. This is exactly why the HeapTupleSatisfiesFOO() functions all test TransactionIdIsInProgress() first and TransactionIdDidCommit() only if it returns false. I don't think it's really legal to test TransactionIdDidCommit() without checking TransactionIdIsInProgress() first. And I bet that's exactly what this code is doing... -- Robert Haas EDB: http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: