From 66c4ca688b14bfb149d35560690cd141a1d9e1db Mon Sep 17 00:00:00 2001 From: wshwsh12 <793703860@qq.com> Date: Mon, 13 Feb 2023 11:22:59 +0800 Subject: [PATCH] fix --- executor/hash_table.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/executor/hash_table.go b/executor/hash_table.go index 2bfdc05c69244..50acc4447f4df 100644 --- a/executor/hash_table.go +++ b/executor/hash_table.go @@ -214,8 +214,8 @@ func (c *hashRowContainer) GetAllMatchedRows(probeHCtx *hashContext, probeSideRo return matched, nil } -// signalCheckpointForJoin indicates the times of row probe that a signal detection will be triggered. -const signalCheckpointForJoin int = 1 << 14 +// signalCheckpointForJoinMask indicates the times of row probe that a signal detection will be triggered. +const signalCheckpointForJoinMask int = 1<<14 - 1 // rowSize is the size of Row. const rowSize = int64(unsafe.Sizeof(chunk.Row{})) @@ -241,7 +241,7 @@ func (c *hashRowContainer) GetMatchedRowsAndPtrs(probeKey uint64, probeRow chunk matchedDataSize = int64(cap(matched))*rowSize + int64(cap(matchedPtrs))*rowPtrSize lastChunkBufPointer *chunk.Chunk = nil memDelta int64 = 0 - needTrackMemUsage = cap(innerPtrs) > signalCheckpointForJoin + needTrackMemUsage = cap(innerPtrs) > signalCheckpointForJoinMask ) c.chkBuf = nil c.memTracker.Consume(-c.chkBufSizeForOneProbe) @@ -267,7 +267,7 @@ func (c *hashRowContainer) GetMatchedRowsAndPtrs(probeKey uint64, probeRow chunk memDelta += lastChunkSize } lastChunkBufPointer = c.chkBuf - if needTrackMemUsage && (i&signalCheckpointForJoin == (signalCheckpointForJoin - 1)) { + if needTrackMemUsage && (i&signalCheckpointForJoinMask == signalCheckpointForJoinMask) { // Trigger Consume for checking the OOM Action signal memDelta += int64(cap(matched))*rowSize + int64(cap(matchedPtrs))*rowPtrSize - matchedDataSize matchedDataSize = int64(cap(matched))*rowSize + int64(cap(matchedPtrs))*rowPtrSize