Re: Write Ahead Logging for Hash Indexes
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Ashutosh Sharma <ashu.coek88@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2016-09-13T11:22:39Z
Lists: pgsql-hackers
On Mon, Sep 12, 2016 at 11:29 AM, Jeff Janes <jeff.janes@gmail.com> wrote: > > > My test program (as posted) injects crashes and then checks the > post-crash-recovery system for consistency, so it cannot be run as-is > without the WAL patch. I also ran the test with crashing turned off (just > change the JJ* variables at the stop of the do.sh to all be set to the empty > string), and in that case I didn't see either problem, but it it could just > be that I that I didn't run it long enough. > > It should have been long enough to detect the rather common "buffer <x> is > not owned by resource owner Portal" problem, so that one I think is specific > to the WAL patch (probably the part which tries to complete bucket splits > when it detects one was started but not completed?) > Both the problem seems to be due to same reason and in concurrent hash index patch. So what is happening here is that we are trying to unpin the old bucket buffer twice. We need to scan the old bucket when there is a incomplete-split, so the issue here is that during split the system has crashed and after restart, during old bucket scan it tries to unpin the old primary bucket buffer twice when the new bucket has additional overflow pages. I will post the updated patch on concurrent hash index thread. Once, I post the patch, it is better if you try to reproduce the issue once more. Thanks to Ashutosh Sharma who has offlist shared the call stack after reproducing the problem. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com
Commits
-
Add a regression test for snapshot too old with hash indexes.
- 42bdaebf1618 10.0 landed
-
hash: Add write-ahead logging support.
- c11453ce0aea 10.0 landed
-
Improve coding in _hash_addovflpage.
- e898437460f5 10.0 cited
-
Remove _hash_wrtbuf() in favor of calling MarkBufferDirty().
- 25216c989384 10.0 cited
-
Improve hash index bucket split behavior.
- 6d46f4783efe 10.0 cited