@@ -932,7 +932,7 @@ func (w *GCWorker) redoDeleteRanges(ctx context.Context, safePoint uint64, concu
932
932
return nil
933
933
}
934
934
935
- func (w * GCWorker ) doUnsafeDestroyRangeRequest (ctx context.Context , startKey []byte , endKey []byte , concurrency int ) error {
935
+ func (w * GCWorker ) doUnsafeDestroyRangeRequest (ctx context.Context , startKey []byte , endKey []byte , _ int ) error {
936
936
// Get all stores every time deleting a region. So the store list is less probably to be stale.
937
937
stores , err := w .getStoresForGC (ctx )
938
938
if err != nil {
@@ -1489,7 +1489,7 @@ func (w *GCWorker) saveValueToSysTable(key, value string) error {
1489
1489
// GC placement rules when the partitions are removed by the GC worker.
1490
1490
// Placement rules cannot be removed immediately after drop table / truncate table,
1491
1491
// because the tables can be flashed back or recovered.
1492
- func (w * GCWorker ) doGCPlacementRules (se sessiontypes.Session , safePoint uint64 , dr util.DelRangeTask , gcPlacementRuleCache map [int64 ]any ) (err error ) {
1492
+ func (w * GCWorker ) doGCPlacementRules (se sessiontypes.Session , _ uint64 , dr util.DelRangeTask , gcPlacementRuleCache map [int64 ]any ) (err error ) {
1493
1493
// Get the job from the job history
1494
1494
var historyJob * model.Job
1495
1495
failpoint .Inject ("mockHistoryJobForGC" , func (v failpoint.Value ) {
@@ -1544,16 +1544,8 @@ func (w *GCWorker) doGCPlacementRules(se sessiontypes.Session, safePoint uint64,
1544
1544
return
1545
1545
}
1546
1546
1547
- for _ , id := range physicalTableIDs {
1548
- // Delete pd rule
1549
- failpoint .Inject ("gcDeletePlacementRuleCounter" , func () {})
1550
- logutil .BgLogger ().Info ("try delete TiFlash pd rule" ,
1551
- zap .Int64 ("tableID" , id ), zap .String ("endKey" , string (dr .EndKey )), zap .Uint64 ("safePoint" , safePoint ))
1552
- ruleID := infosync .MakeRuleID (id )
1553
- if err := infosync .DeleteTiFlashPlacementRule (context .Background (), "tiflash" , ruleID ); err != nil {
1554
- logutil .BgLogger ().Error ("delete TiFlash pd rule failed when gc" ,
1555
- zap .Error (err ), zap .String ("ruleID" , ruleID ), zap .Uint64 ("safePoint" , safePoint ))
1556
- }
1547
+ if err := infosync .DeleteTiFlashPlacementRules (context .Background (), physicalTableIDs ); err != nil {
1548
+ logutil .BgLogger ().Error ("delete placement rules failed" , zap .Error (err ), zap .Int64s ("tableIDs" , physicalTableIDs ))
1557
1549
}
1558
1550
bundles := make ([]* placement.Bundle , 0 , len (physicalTableIDs ))
1559
1551
for _ , id := range physicalTableIDs {
0 commit comments