fix: Check whether compaction plan exist before update (#28826)

Fix: #28825

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2023-11-29 18:54:27 +08:00 committed by GitHub
parent 3b1b14dd78
commit 3f9da2b8a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,7 +197,11 @@ func (c *compactionPlanHandler) removeTasksByChannel(channel string) {
func (c *compactionPlanHandler) updateTask(planID int64, opts ...compactionTaskOpt) {
c.mu.Lock()
defer c.mu.Unlock()
c.plans[planID] = c.plans[planID].shadowClone(opts...)
plan, ok := c.plans[planID]
if !ok {
return
}
c.plans[planID] = plan.shadowClone(opts...)
}
func (c *compactionPlanHandler) enqueuePlan(signal *compactionSignal, plan *datapb.CompactionPlan) error {