Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-07-04 Thread Andres Freund
Hi, On 2018-06-27 12:16:29 -0700, Andres Freund wrote: > I think we should backpatch those checks - it's a fairly nasty situation > for users to not be able to even drop an index without going to single > user mode. Did that back to 9.4 - before that page deletion and splits worked differently en

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Peter Geoghegan
On Wed, Jun 27, 2018 at 1:11 PM, Andres Freund wrote: > Well, I don't really want to generally do better. Just be able to check > for interrupts ;) That's what I meant. :-) -- Peter Geoghegan

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Andres Freund
On 2018-06-27 13:02:25 -0700, Peter Geoghegan wrote: > On Wed, Jun 27, 2018 at 12:52 PM, Andres Freund wrote: > > A related question is if it matters - without complicating the code I > > don't see how we could release all the locks in that loop. Therefore no > > interrupts can be accepted. I hop

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Peter Geoghegan
On Wed, Jun 27, 2018 at 12:52 PM, Andres Freund wrote: > A related question is if it matters - without complicating the code I > don't see how we could release all the locks in that loop. Therefore no > interrupts can be accepted. I hope I'm missing something? I agree. In general, page deletion

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Andres Freund
Hi, On 2018-06-27 12:49:56 -0700, Peter Geoghegan wrote: > On Wed, Jun 27, 2018 at 12:18 PM, Andres Freund wrote: > > It's possibly wrong that it's unreachable - I've just not managed to get > > there. If somebody has an idea how to build a reproducible case to reach > > it... > > Set a breakpoi

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Peter Geoghegan
On Wed, Jun 27, 2018 at 12:18 PM, Andres Freund wrote: > It's possibly wrong that it's unreachable - I've just not managed to get > there. If somebody has an idea how to build a reproducible case to reach > it... Set a breakpoint in _bt_unlink_halfdead_page() after the initial "LockBuffer(leafbuf

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Andres Freund
Hi, On 2018-06-27 12:16:29 -0700, Andres Freund wrote: > I couldn't see how to fix the _bt_unlink_halfdead_page() right-sib loop, > because we always hold a lock. But given that that loop appears to > mostly be dead code, that doesn't seem too bad? It's possibly wrong that it's unreachable - I've

Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Andres Freund
Hi, A couple times, one very recently, I've encountered btrees that somehow had corrupted right links. The links formed a cycle, involving a number of pages. As of yet it's unclear to me where the corruption is originating from - could be a storage issue or a postgres issue. What makes that kin