summaryrefslogtreecommitdiff
path: root/contrib/bloom/blvacuum.c
diff options
context:
space:
mode:
authorTeodor Sigaev2016-04-02 10:47:04 +0000
committerTeodor Sigaev2016-04-02 10:47:04 +0000
commit80afb62db0f118f70367a357cef0509a11112ebb (patch)
tree08d2a437f93f159aaa901996b832eca2da43dbd5 /contrib/bloom/blvacuum.c
parentc22650cd6450854e1a75064b698d7dcbb4a8821a (diff)
Fixes in bloom contrib module
Looking at result of buildfarm member jaguarundi it seems to me that BloomOptions isn't inited sometime, but I don't see yet how it's possible. Nevertheless, check of signature length's is missed, so, add a limit of it. Also add missed GenericXLogAbort() in case of already deleted page in vacuum + minor code refactoring.
Diffstat (limited to 'contrib/bloom/blvacuum.c')
-rw-r--r--contrib/bloom/blvacuum.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/bloom/blvacuum.c b/contrib/bloom/blvacuum.c
index d976ce53305..9fee3c1294f 100644
--- a/contrib/bloom/blvacuum.c
+++ b/contrib/bloom/blvacuum.c
@@ -70,14 +70,15 @@ blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
if (BloomPageIsDeleted(page))
{
UnlockReleaseBuffer(buffer);
+ GenericXLogAbort(gxlogState);
CHECK_FOR_INTERRUPTS();
continue;
}
/* Iterate over the tuples */
- itup = BloomPageGetTuple(&state, page, 1);
- itupPtr = BloomPageGetTuple(&state, page, 1);
- itupEnd = BloomPageGetTuple(&state, page, BloomPageGetMaxOffset(page) + 1);
+ itup = itupPtr = BloomPageGetTuple(&state, page, FirstOffsetNumber);
+ itupEnd = BloomPageGetTuple(&state, page,
+ OffsetNumberNext(BloomPageGetMaxOffset(page)));
while (itup < itupEnd)
{
/* Do we have to delete this tuple? */
@@ -104,10 +105,10 @@ blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
itup = BloomPageGetNextTuple(&state, itup);
}
- Assert(itupPtr == BloomPageGetTuple(&state, page, BloomPageGetMaxOffset(page) + 1));
+ Assert(itupPtr == BloomPageGetTuple(&state, page,
+ OffsetNumberNext(BloomPageGetMaxOffset(page))));
- if (!BloomPageIsDeleted(page) &&
- BloomPageGetFreeSpace(&state, page) > state.sizeOfBloomTuple &&
+ if (BloomPageGetFreeSpace(&state, page) > state.sizeOfBloomTuple &&
countPage < BloomMetaBlockN)
notFullPage[countPage++] = blkno;