Re: Write Ahead Logging for Hash Indexes
Jeff Janes <jeff.janes@gmail.com>
From: Jeff Janes <jeff.janes@gmail.com>
To: Ashutosh Sharma <ashu.coek88@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2016-09-12T01:30:38Z
Lists: pgsql-hackers
Attachments
- count.pl (application/octet-stream)
- crash_REL10.patch (application/octet-stream) patch
- do.sh (application/x-sh)
On Thu, Sep 8, 2016 at 12:09 PM, Jeff Janes <jeff.janes@gmail.com> wrote: > I plan to do testing using my own testing harness after changing it to > insert a lot of dummy tuples (ones with negative values in the pseudo-pk > column, which are never queried by the core part of the harness) and > deleting them at random intervals. I think that none of pgbench's built in > tests are likely to give the bucket splitting and squeezing code very much > exercise. > I've implemented this, by adding lines 197 through 202 to the count.pl script. (I'm reattaching the test case) Within a few minutes of testing, I start getting Errors like these: 29236 UPDATE XX000 2016-09-11 17:21:25.893 PDT:ERROR: buffer 2762 is not owned by resource owner Portal 29236 UPDATE XX000 2016-09-11 17:21:25.893 PDT:STATEMENT: update foo set count=count+1 where index=$1 In one test, I also got an error from my test harness itself indicating tuples are transiently missing from the index, starting an hour into a test: child abnormal exit update did not update 1 row: key 9555 updated 0E0 at count.pl line 194.\n at count.pl line 208. child abnormal exit update did not update 1 row: key 8870 updated 0E0 at count.pl line 194.\n at count.pl line 208. child abnormal exit update did not update 1 row: key 8453 updated 0E0 at count.pl line 194.\n at count.pl line 208. Those key values should always find exactly one row to update. If the tuples were permanently missing from the index, I would keep getting errors on the same key values very frequently. But I don't get that, the errors remain infrequent and are on different value each time, so I think the tuples are in the index but the scan somehow misses them, either while the bucket is being split or while it is being squeezed. This on a build without enable-asserts. Any ideas on how best to go about investigating this? Cheers, Jeff
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