<br /><br /><div class="gmail_quote">On Thu, Jan 17, 2013 at 2:57 PM, Abhijit Menon-Sen <span dir="ltr"><<a
href="mailto:ams@2ndquadrant.com"target="_blank">ams@2ndquadrant.com</a>></span> wrote:<br /><blockquote
class="gmail_quote"style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br /><br /> There was
considerablediscussion after this (accessible through the<br /> archives link above), which I won't attempt to
summarise.<br/><span class="HOEnZb"><font color="#888888"></font></span><br clear="all" /></blockquote></div><br />I
thoughtRobert made those comments after considerable discussions on Jeff's approach. So he probably still stands by his
objectionsor at least not satisfied/seen the numbers.<br /><br />Now that I look at the patch, I wonder if there is
anotherfundamental issue with the patch. Since the patch removes WAL logging for the VM set operation, this can
happen:<br/><br />1. Vacuum kicks in and clears all dead tuples in a page and decides that its all-visible<br /> 2.
VacuumWAL-logs the cleanup activity and marks the page dirty<br />3. Vacuum sets the visibility bit and marks the VM
pagedirty<br />4. Say the VM page gets written to the disk. The heap page is not yet written neither the WAL log
correspondingto the cleanup operation<br /> 5. CRASH<br /><br />After recovery, the VM bit will remain set because the
VMpage got written before the crash. But since heap page's cleanup WAL did not made to the disk, those operations won't
bereplayed. The heap page will be left with not-all-visible tuples in that case and its not a good state to be in.<br
/><br/>The original code does not have this problem because the VM set WAL gets written after the heap page cleanup
WAL.So its guaranteed that the VM bit will be set during recovery only if the cleanup WAL is replayed too (there is
moremagic than what meets the eye and I think its not fully documented). <br /><br />Thanks,<br />Pavan<br /><br />--
<br/>Pavan Deolasee<br /><a href="http://www.linkedin.com/in/pavandeolasee"
target="_blank">http://www.linkedin.com/in/pavandeolasee</a>