1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

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.
This commit is contained in:
Teodor Sigaev
2016-04-02 13:47:04 +03:00
parent c22650cd64
commit 80afb62db0
3 changed files with 20 additions and 10 deletions

View File

@ -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;