-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.component/tiflashtype/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Enhancement
Now in gc worker, we delete placement rules of TiFlash one by one. It may takes a long time when drop database or drop table with a lot of partitions. We can easily optimize it by batch delete.
tidb/pkg/store/gcworker/gc_worker.go
Lines 1547 to 1557 in 8f56847
| for _, id := range physicalTableIDs { | |
| // Delete pd rule | |
| failpoint.Inject("gcDeletePlacementRuleCounter", func() {}) | |
| logutil.BgLogger().Info("try delete TiFlash pd rule", | |
| zap.Int64("tableID", id), zap.String("endKey", string(dr.EndKey)), zap.Uint64("safePoint", safePoint)) | |
| ruleID := infosync.MakeRuleID(id) | |
| if err := infosync.DeleteTiFlashPlacementRule(context.Background(), "tiflash", ruleID); err != nil { | |
| logutil.BgLogger().Error("delete TiFlash pd rule failed when gc", | |
| zap.Error(err), zap.String("ruleID", ruleID), zap.Uint64("safePoint", safePoint)) | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.component/tiflashtype/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.