pd icon indicating copy to clipboard operation
pd copied to clipboard

Evict-leader should stop leader transfer into stores with 'reject-leader' label while not

Open AndreMouche opened this issue 2 years ago • 1 comments

Bug Report

it seems the command of evict-leader does not stop other leaders transfer into it.

What did you do?

30 tikv/3pd/3tidb

  1. pd-ctl config set label-property reject-leader zone XXX

And in PD's log

[2023/01/10 10:56:35.910 +08:00] [INFO] [server.go:997] ["label property config is updated"] [config="{"reject-leader":[{"key":"zone","value":"xxx"}]}"]

It shows that evict-leader was set successfully, while I can still find that pd try to transfer leader from other store to the stores with regect-leader label: here store 15,store 16 shares the zone xxx

[2023/01/10 10:58:30.244 +08:00] [INFO] [operator_controller.go:635] ["send schedule command"] [region-id=235] [step="transfer leader from store 13 to store 15"] [source=create]

[2023/01/10 12:59:32.245 +08:00] [INFO] [operator_controller.go:635] ["send schedule command"] [region-id=723] [step="transfer leader from store 17 to store 16"] [source=create]

What did you expect to see?

no leader should transfer into the store with reject-leader label.

What did you see instead?

PD try to transfer leader into the store with reject-leader label

What version of PD are you using (pd-server -V)?

v5.4.0

AndreMouche avatar Jan 11 '23 09:01 AndreMouche

I don't reproduce this issue in my local environment with the following steps:

  1. start a cluster with 4 tikv using tiup
  2. change the store 6 label by using pd-ctl store label 6 zone=z1
  3. execute config set label-property reject-leader zone z1
  4. execute scheduler add evict-leader-scheduler 1

The leader in store 6 has not changed.

rleungx avatar Sep 02 '24 07:09 rleungx

I have double-checked but I cannot reproduce it in both v5.4.0 and master. Close it for now.

rleungx avatar Mar 06 '25 06:03 rleungx

Image The filter works as expected.

rleungx avatar Mar 06 '25 06:03 rleungx