From aea3cfefce712b044d4337bd481f7148a349d473 Mon Sep 17 00:00:00 2001 From: congqixia Date: Mon, 17 Jun 2024 23:14:00 +0800 Subject: [PATCH] fix: [2.3] Prevent use captured iteration variable partitionID (#33912) Cherry-pick from master pr: #33906 See also #33902 Signed-off-by: Congqi Xia --- internal/querynodev2/delegator/delegator_data.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/querynodev2/delegator/delegator_data.go b/internal/querynodev2/delegator/delegator_data.go index 1b49d7f268..f7ac487771 100644 --- a/internal/querynodev2/delegator/delegator_data.go +++ b/internal/querynodev2/delegator/delegator_data.go @@ -279,8 +279,9 @@ func (sd *shardDelegator) applyBFInParallel(deleteDatas []*DeleteData, pool *con retIdx += 1 tmpRetIdx := retIdx deleteDataId := didx + partitionID := data.PartitionID future := pool.Submit(func() (any, error) { - ret := sd.pkOracle.BatchGet(pks[startIdx:endIdx], pkoracle.WithPartitionID(data.PartitionID)) + ret := sd.pkOracle.BatchGet(pks[startIdx:endIdx], pkoracle.WithPartitionID(partitionID)) retMap.Insert(tmpRetIdx, &BatchApplyRet{ DeleteDataIdx: deleteDataId, StartIdx: startIdx,