Skip to content

Commit

Permalink
[columnar] [Bug]: Vacuum still fails by hanging indefinitely
Browse files Browse the repository at this point in the history
During vacuum, stripes are collected in reverse order and if row number
is greater than defined limit we should stop and combine previous stripe into
them into one. Problem is that while writing rows into temporary write state
object - this condition is not greater but greater or equal which lead to infinite
loop. Fixed by using proper comparison operator when stripe candidates are
choosen.
  • Loading branch information
mkaruza committed May 16, 2023
1 parent ac1c5bd commit 65fb1f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion columnar/src/backend/columnar/columnar_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ ReadChunkGroupRowCounts(uint64 storageId, uint64 stripe, uint32 chunkGroupCount,
HeapTuple heapTuple = NULL;

*chunkGroupRowCounts = palloc0(chunkGroupCount * sizeof(uint32));
*chunkGroupDeletedRows = palloc(chunkGroupCount * sizeof(uint32));
*chunkGroupDeletedRows = palloc0(chunkGroupCount * sizeof(uint32));

/*
* Since we have now updates of `chunk_group`, there could be multiple tuples
Expand Down
2 changes: 1 addition & 1 deletion columnar/src/backend/columnar/columnar_tableam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ TruncateAndCombineColumnarStripes(Relation rel, int elevel)

uint64 stripeRowCount = stripeMetadata->rowCount - lastStripeDeletedRows;

if ((totalRowNumberCount + stripeRowCount > columnarOptions.stripeRowCount))
if ((totalRowNumberCount + stripeRowCount >= columnarOptions.stripeRowCount))
{
break;
}
Expand Down

0 comments on commit 65fb1f3

Please sign in to comment.