@@ -23,6 +23,8 @@ import (
23
23
"sync"
24
24
"time"
25
25
26
+ "github.com/golang/glog"
27
+
26
28
"github.com/pingcap/kvproto/pkg/metapb"
27
29
"github.com/pingcap/kvproto/pkg/pdpb"
28
30
"github.com/pingcap/pd/pkg/typeutil"
@@ -472,9 +474,15 @@ func (pc *pdClient) EndEvictLeader(storeID uint64) error {
472
474
return err
473
475
}
474
476
defer httputil .DeferClose (res .Body )
475
- if res .StatusCode == http .StatusOK || res . StatusCode == http . StatusNotFound {
477
+ if res .StatusCode == http .StatusNotFound {
476
478
return nil
477
479
}
480
+ if res .StatusCode == http .StatusOK {
481
+ glog .Infof ("call DELETE method: %s success" , apiURL )
482
+ } else {
483
+ err2 := httputil .ReadErrorBody (res .Body )
484
+ glog .Errorf ("call DELETE method: %s failed,statusCode: %v,error: %v" , apiURL , res .StatusCode , err2 )
485
+ }
478
486
479
487
// pd will return an error with the body contains "scheduler not found" if the scheduler is not found
480
488
// this is not the standard response.
@@ -483,14 +491,13 @@ func (pc *pdClient) EndEvictLeader(storeID uint64) error {
483
491
// - return nil if the scheduler is not found
484
492
//
485
493
// when PD returns standard json response, we should get rid of this verbose code.
486
- err2 := httputil .ReadErrorBody (res .Body )
487
494
evictLeaderSchedulers , err := pc .GetEvictLeaderSchedulers ()
488
495
if err != nil {
489
496
return err
490
497
}
491
498
for _ , s := range evictLeaderSchedulers {
492
499
if s == sName {
493
- return fmt .Errorf ("failed %v to end leader evict scheduler of store [%d], error: %v" , res . StatusCode , storeID , err2 )
500
+ return fmt .Errorf ("end leader evict scheduler failed,the store: [%d]'s leader evict scheduler is still exist" , storeID )
494
501
}
495
502
}
496
503
0 commit comments