Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updatedtuple
От | Alvaro Herrera |
---|---|
Тема | Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updatedtuple |
Дата | |
Msg-id | 20171005162402.jahqflf3mekileqm@alvherre.pgsql обсуждение исходный текст |
Ответ на | Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updatedtuple (Alvaro Herrera <alvherre@alvh.no-ip.org>) |
Ответы |
Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
|
Список | pgsql-hackers |
I think this is the patch for 9.3. I ran the test a few hundred times (with some additional changes such as randomly having an update inside a savepoint that's randomly aborted, randomly aborting the transaction, randomly skipping the for key share lock, randomly sleeping at a few points; and also adding filler columns, reducing fillfactor and using 5, 50, 180, 250, 500 sessions after verifying that it causes the tuples to stay in the same page or migrate to later pages). The final REINDEX has never complained again about failing to find the root tuple. I hope it's good now. The attached patch needs a few small tweaks, such as improving commentary in the new function, maybe turn it into a macro (otherwise I think it could be bad for performance; I'd like a static func but not sure those are readily available in 9.3), change the XID comparison to use the appropriate macro rather than ==, and such. Regarding changes of xmin/xmax comparison, I also checked manually the spots I thought should be modified and later double-checked against the list that Michael posted. It's a match, except for rewriteheap.c which I cannot make heads or tails about. (I think it's rather unfortunate that it sticks a tuple's Xmax into a field that's called Xmin, but let's put that aside). Maybe there's a problem here, maybe there isn't. I'm now going to forward-port this to 9.4. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Вложения
В списке pgsql-hackers по дате отправления: