From 08375a523d7f2f6ee765a22cdda97d738fc683be Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 13 Dec 2022 15:44:26 +0800 Subject: [PATCH] fix: fix invalid retrieved buf page --- source/libs/function/src/tpercentile.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/libs/function/src/tpercentile.c b/source/libs/function/src/tpercentile.c index 27d029aaa5..157ee08f15 100644 --- a/source/libs/function/src/tpercentile.c +++ b/source/libs/function/src/tpercentile.c @@ -364,6 +364,7 @@ int32_t tMemBucketPut(tMemBucket *pBucket, const void *data, size_t size) { assert(pSlot->info.data->num >= pBucket->elemPerPage && pSlot->info.size > 0); // keep the pointer in memory + setBufPageDirty(pSlot->info.data, true); releaseBufPage(pBucket->pBuffer, pSlot->info.data); pSlot->info.data = NULL; } @@ -505,6 +506,7 @@ double getPercentileImpl(tMemBucket *pMemBucket, int32_t count, double fraction) SFilePage *pg = getBufPage(pMemBucket->pBuffer, *pageId); tMemBucketPut(pMemBucket, pg->data, (int32_t)pg->num); + setBufPageDirty(pg, true); releaseBufPage(pMemBucket->pBuffer, pg); }