Skip to content

Commit e9e441c

Browse files
committed
Prevent mark as deleted and as 'has free space' page in bloom module
Vacuum might put page into list of pages with some free space and mark as deleted at the same time.
1 parent 80afb62 commit e9e441c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

contrib/bloom/blvacuum.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,20 @@ blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
108108
Assert(itupPtr == BloomPageGetTuple(&state, page,
109109
OffsetNumberNext(BloomPageGetMaxOffset(page))));
110110

111-
if (BloomPageGetFreeSpace(&state, page) > state.sizeOfBloomTuple &&
111+
/*
112+
* Add page to notFullPage list if we will not mark page as deleted and
113+
* there is a free space on it
114+
*/
115+
if (BloomPageGetMaxOffset(page) == 0 &&
116+
BloomPageGetFreeSpace(&state, page) > state.sizeOfBloomTuple &&
112117
countPage < BloomMetaBlockN)
113118
notFullPage[countPage++] = blkno;
114119

115120
/* Did we delete something? */
116121
if (itupPtr != itup)
117122
{
118123
/* Is it empty page now? */
119-
if (itupPtr == BloomPageGetData(page))
124+
if (BloomPageGetMaxOffset(page) == 0)
120125
BloomPageSetDeleted(page);
121126
/* Adjust pg_lower */
122127
((PageHeader) page)->pd_lower = (Pointer) itupPtr - page;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy