Re: [HACKERS] Gin page deletion bug

2013-11-08 Thread Heikki Linnakangas
On 08.11.2013 19:14, Tom Lane wrote: Heikki Linnakangas writes: I came up with the attached fix. In a nutshell, when walking along a right-link, the new page is locked before releasing the lock on the old one. Also, never delete the leftmost branch of a posting tree. I believe these changes are

Re: [HACKERS] Gin page deletion bug

2013-11-08 Thread Tom Lane
Heikki Linnakangas writes: > I came up with the attached fix. In a nutshell, when walking along a > right-link, the new page is locked before releasing the lock on the old > one. Also, never delete the leftmost branch of a posting tree. I believe > these changes are sufficient to fix the proble

Re: [HACKERS] Gin page deletion bug

2013-11-08 Thread Heikki Linnakangas
On 07.11.2013 22:49, Heikki Linnakangas wrote: Gin page deletion fails to take into account that there might be a search in-flight to the page that is deleted. If the page is reused for something else, the search can get very confused. ... The regular b-tree code solves this by stamping deleted

[HACKERS] Gin page deletion bug

2013-11-07 Thread Heikki Linnakangas
Gin page deletion fails to take into account that there might be a search in-flight to the page that is deleted. If the page is reused for something else, the search can get very confused. That's pretty difficult to reproduce in a real system, as the window between releasing a lock on page and