Re: Write Ahead Logging for Hash Indexes

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jesper Pedersen <jesper.pedersen@redhat.com>, Jeff Janes <jeff.janes@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-03-10T12:08:49Z
Lists: pgsql-hackers
On Fri, Mar 10, 2017 at 8:49 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Thu, Mar 9, 2017 at 9:34 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>> Do we really need to set LSN on this page (or mark it dirty), if so
>> why?  Are you worried about restoration of FPI or something else?
>
> I haven't thought through all of the possible consequences and am a
> bit to tired to do so just now, but doesn't it seem rather risky to
> invent a whole new way of using these xlog functions?
> src/backend/access/transam/README describes how to do write-ahead
> logging properly, and neither MarkBufferDirty() nor PageSetLSN() is
> described as an optional step.
>

Just to salvage my point, I think this is not the first place where we
register buffer, but don't set lsn.  For XLOG_HEAP2_VISIBLE, we
register heap and vm buffers but set the LSN conditionally on heap
buffer.  Having said that, I see the value of your point and I am open
to doing it that way if you feel that is a better way.


-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


Commits

  1. Add a regression test for snapshot too old with hash indexes.

  2. hash: Add write-ahead logging support.

  3. Improve coding in _hash_addovflpage.

  4. Remove _hash_wrtbuf() in favor of calling MarkBufferDirty().

  5. Improve hash index bucket split behavior.