Skip to content

Commit 66c4ca6

Browse files
committed
fix
1 parent 6f99eba commit 66c4ca6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

executor/hash_table.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ func (c *hashRowContainer) GetAllMatchedRows(probeHCtx *hashContext, probeSideRo
214214
return matched, nil
215215
}
216216

217-
// signalCheckpointForJoin indicates the times of row probe that a signal detection will be triggered.
218-
const signalCheckpointForJoin int = 1 << 14
217+
// signalCheckpointForJoinMask indicates the times of row probe that a signal detection will be triggered.
218+
const signalCheckpointForJoinMask int = 1<<14 - 1
219219

220220
// rowSize is the size of Row.
221221
const rowSize = int64(unsafe.Sizeof(chunk.Row{}))
@@ -241,7 +241,7 @@ func (c *hashRowContainer) GetMatchedRowsAndPtrs(probeKey uint64, probeRow chunk
241241
matchedDataSize = int64(cap(matched))*rowSize + int64(cap(matchedPtrs))*rowPtrSize
242242
lastChunkBufPointer *chunk.Chunk = nil
243243
memDelta int64 = 0
244-
needTrackMemUsage = cap(innerPtrs) > signalCheckpointForJoin
244+
needTrackMemUsage = cap(innerPtrs) > signalCheckpointForJoinMask
245245
)
246246
c.chkBuf = nil
247247
c.memTracker.Consume(-c.chkBufSizeForOneProbe)
@@ -267,7 +267,7 @@ func (c *hashRowContainer) GetMatchedRowsAndPtrs(probeKey uint64, probeRow chunk
267267
memDelta += lastChunkSize
268268
}
269269
lastChunkBufPointer = c.chkBuf
270-
if needTrackMemUsage && (i&signalCheckpointForJoin == (signalCheckpointForJoin - 1)) {
270+
if needTrackMemUsage && (i&signalCheckpointForJoinMask == signalCheckpointForJoinMask) {
271271
// Trigger Consume for checking the OOM Action signal
272272
memDelta += int64(cap(matched))*rowSize + int64(cap(matchedPtrs))*rowPtrSize - matchedDataSize
273273
matchedDataSize = int64(cap(matched))*rowSize + int64(cap(matchedPtrs))*rowPtrSize

0 commit comments

Comments
 (0)