diff --git a/pkg/executor/join/hash_join_spill_helper.go b/pkg/executor/join/hash_join_spill_helper.go index e2612f0d4e11f..7d8ec2150a1ae 100644 --- a/pkg/executor/join/hash_join_spill_helper.go +++ b/pkg/executor/join/hash_join_spill_helper.go @@ -81,7 +81,7 @@ type hashJoinSpillHelper struct { spillTriggedInBuildingStageForTest bool spillTriggeredBeforeBuildingHashTableForTest bool allPartitionsSpilledForTest bool - skipProbeInRestoreForTest bool + skipProbeInRestoreForTest atomic.Bool } func newHashJoinSpillHelper(hashJoinExec *HashJoinV2Exec, partitionNum int, probeFieldTypes []*types.FieldType) *hashJoinSpillHelper { @@ -554,7 +554,7 @@ func (h *hashJoinSpillHelper) initTmpSpillBuildSideChunks() { } func (h *hashJoinSpillHelper) isProbeSkippedInRestoreForTest() bool { - return h.skipProbeInRestoreForTest + return h.skipProbeInRestoreForTest.Load() } func (h *hashJoinSpillHelper) isRespillTriggeredForTest() bool { diff --git a/pkg/executor/join/hash_join_v2.go b/pkg/executor/join/hash_join_v2.go index ca18d0d58eb63..abb7657ae5562 100644 --- a/pkg/executor/join/hash_join_v2.go +++ b/pkg/executor/join/hash_join_v2.go @@ -933,7 +933,7 @@ func (w *ProbeWorkerV2) processOneProbeChunk(probeChunk *chunk.Chunk, joinResult func (w *ProbeWorkerV2) probeAndSendResult(joinResult *hashjoinWorkerResult) (bool, int64, *hashjoinWorkerResult) { if w.HashJoinCtx.spillHelper.areAllPartitionsSpilled() { if intest.InTest && w.HashJoinCtx.spillHelper.hashJoinExec.inRestore { - w.HashJoinCtx.spillHelper.skipProbeInRestoreForTest = true + w.HashJoinCtx.spillHelper.skipProbeInRestoreForTest.Store(true) } return true, 0, joinResult }