Re: new heapcheck contrib module
Mark Dilger <mark.dilger@enterprisedb.com>
Attachments
- WIP_dilip_kumar_idea.patch (application/octet-stream) patch
- (unnamed) (text/plain)
> On Jun 11, 2020, at 9:14 AM, Dilip Kumar <dilipbalaut@gmail.com> wrote: > > I have just browsed through the patch and the idea is quite > interesting. I think we can expand it to check that whether the flags > set in the infomask are sane or not w.r.t other flags and xid status. > Some examples are > > - If HEAP_XMAX_LOCK_ONLY is set in infomask then HEAP_KEYS_UPDATED > should not be set in new_infomask2. > - If HEAP_XMIN(XMAX)_COMMITTED is set in the infomask then can we > actually cross verify the transaction status from the CLOG and check > whether is matching the hint bit or not. > > While browsing through the code I could not find that we are doing > this kind of check, ignore if we are already checking this. Thanks for taking a look! Having both of those bits set simultaneously appears to fall into a different category than what I wrote verify_heapam.c to detect. It doesn't violate any assertion in the backend, nor does it cause the code to crash. (At least, I don't immediately see how it does either of those things.) At first glance it appears invalid to have those bits both set simultaneously, but I'm hesitant to enforce that without good reason. If it is a good thing to enforce, should we also change the backend code to Assert? I integrated your idea into one of the regression tests. It now sets these two bits in the header of one of the rows in a table. The verify_heapam check output (which includes all detected corruptions) does not change, which verifies your observation that verify_heapam is not checking for this. I've attached that as a patch to this email. Note that this patch should be applied atop the v6 patch recently posted in another email.
Commits
-
Add pg_amcheck, a CLI for contrib/amcheck.
- 9706092839db 14.0 landed
-
Refactor and generalize the ParallelSlot machinery.
- f71519e545a3 14.0 landed
-
Generalize parallel slot result handling.
- 418611c84d00 14.0 landed
-
Move some code from src/bin/scripts to src/fe_utils to permit reuse.
- e955bd4b6c2b 14.0 landed
-
Factor pattern-construction logic out of processSQLNamePattern.
- 2c8726c4b0a4 14.0 landed
-
Doc: clean up verify_heapam() documentation.
- 4c49d8fc15ee 14.0 landed
-
Fix more portability issues in new amcheck code.
- 321633e17b07 14.0 landed
-
Fix portability issues in new amcheck test.
- 860593ec3bd1 14.0 landed
-
Try to avoid a compiler warning about using fxid uninitialized.
- 8bb0c9770e80 14.0 landed
-
Extend amcheck to check heap pages.
- 866e24d47db1 14.0 landed
-
Adjust walsender usage of xlogreader, simplify APIs
- 850196b610d2 13.0 cited
-
Improve checking of child pages in contrib/amcheck.
- d114cc538715 13.0 cited
-
Sanitize line pointers within contrib/amcheck.
- a9ce839a3137 12.0 cited
-
Fix possible sorting error when aborting use of abbreviated keys.
- 008c4135ccf6 10.0 cited