Hi hackers,

Two test-only patches.

gist.sql vacuums only once after deleting rows, so the emptied leaf pages
are never recycled or reused, and no test deletes every entry.  Nothing
replays a GiST page deletion through recovery either.

0001 adds those steps to gist.sql.  0002 adds a recovery test that crashes
and restarts the server after the same workload, with
wal_consistency_checking set.  Both compare an index scan against a
sequential scan.

Coverage of src/backend/access/gist goes from 80.3% to 87.9%; the redo side
of gistxlog.c was entirely unexecuted before.

Thanks,
Shihao
################ BEFORE (baseline, no patches) ################
'../src/backend/access/gist/gistutil.c' Lines executed:90.74% of 367
'../src/include/access/gist.h' Lines executed:0.00% of 6
'../src/backend/access/gist/gistxlog.c' Lines executed:17.91% of 268
'../src/include/access/gist.h' Lines executed:0.00% of 6
'../src/backend/access/gist/gistsplit.c' Lines executed:79.32% of 266
'../src/backend/access/gist/gist.c' Lines executed:78.12% of 553
'../src/backend/access/gist/gistproc.c' Lines executed:86.61% of 575
'../src/backend/access/gist/gistbuild.c' Lines executed:96.89% of 450
'../src/backend/access/gist/gistget.c' Lines executed:92.43% of 317
'../src/backend/access/gist/gistscan.c' Lines executed:93.50% of 123
'../src/backend/access/gist/gistbuildbuffers.c' Lines executed:93.80% of 242
'../src/backend/access/gist/gistvalidate.c' Lines executed:77.14% of 105
'../src/backend/access/gist/gistvacuum.c' Lines executed:59.46% of 222
'../src/include/access/gist.h' Lines executed:0.00% of 6

################ AFTER (with the two GiST patches) ################
'../src/backend/access/gist/gistutil.c' Lines executed:94.55% of 367
'../src/include/access/gist.h' Lines executed:83.33% of 6
'../src/backend/access/gist/gistxlog.c' Lines executed:83.58% of 268
'../src/include/access/gist.h' Lines executed:100.00% of 6
'../src/backend/access/gist/gistsplit.c' Lines executed:78.57% of 266
'../src/backend/access/gist/gist.c' Lines executed:78.12% of 553
'../src/backend/access/gist/gistproc.c' Lines executed:86.61% of 575
'../src/backend/access/gist/gistbuild.c' Lines executed:96.89% of 450
'../src/backend/access/gist/gistget.c' Lines executed:92.43% of 317
'../src/backend/access/gist/gistscan.c' Lines executed:93.50% of 123
'../src/backend/access/gist/gistbuildbuffers.c' Lines executed:93.80% of 242
'../src/backend/access/gist/gistvalidate.c' Lines executed:77.14% of 105
'../src/backend/access/gist/gistvacuum.c' Lines executed:90.99% of 222
'../src/include/access/gist.h' Lines executed:100.00% of 6

Attachment: 0001-Test-GiST-page-recycling-and-deleting-all-entries.patch
Description: Binary data

Attachment: 0002-Add-a-recovery-test-for-GiST-page-deletion-and-reuse.patch
Description: Binary data

Reply via email to