tikv / pd

Placement driver for TiKV
Apache License 2.0
1.03k stars 714 forks source link

tools/simulator: support simulator with multiple pds #8304

Closed HuSharp closed 1 week ago

HuSharp commented 1 week ago

What problem does this PR solve?

Issue Number: Ref #8135

What is changed and how does it work?

Test Result

tiup playground v8.0.0 --kv.binpath ./pd-simulator --kv=1 --db=0 --kv.config=../conf/simconfig.toml --pd 3

cluster metrics

image image

add node to trigger balance

after curl --location --request POST 'http://127.0.0.1:20180/event?event=add-node'

image image image

test leader change

run ./pd-ctl member firstly to check leader

    ...
  "leader": {
    "name": "pd-0",
    "member_id": 3474484975246189105,
    "peer_urls": [
      "http://127.0.0.1:2380"
    ],
    "client_urls": [
      "http://127.0.0.1:2379"
    ],
    ...

transfer leader

$ ./pd-ctl member leader transfer pd-1
Success!

heartbeat upload

image image

remove node to trigger balance

curl --location --request POST 'http://127.0.0.1:20180/event?event=down-node'

image image

Check List

Tests

Release note

None.
codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.27%. Comparing base (fbd6bd2) to head (d140be6).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #8304 +/- ## ========================================== - Coverage 77.38% 77.27% -0.11% ========================================== Files 470 470 Lines 61356 61356 ========================================== - Hits 47480 47413 -67 - Misses 10310 10381 +71 + Partials 3566 3562 -4 ``` | [Flag](https://app.codecov.io/gh/tikv/pd/pull/8304/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/tikv/pd/pull/8304/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv) | `77.27% <ø> (-0.11%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#carryforward-flags-in-the-pull-request-comment) to find out more.
ti-chi-bot[bot] commented 1 week ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nolouch, rleungx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/tikv/pd/blob/master/OWNERS)~~ [nolouch,rleungx] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
ti-chi-bot[bot] commented 1 week ago

[LGTM Timeline notifier]

Timeline:

nolouch commented 1 week ago

/merge

ti-chi-bot[bot] commented 1 week ago

@nolouch: We have migrated to builtin LGTM and approve plugins for reviewing.

👉 Please use /approve when you want approve this pull request.

The changes announcement: Proposal: Strengthen configuration change approval.

Instructions for interacting with me using PR comments are available [here](https://prow.tidb.net/command-help). If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.
ti-chi-bot[bot] commented 1 week ago

@HuSharp: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available [here](https://prow.tidb.net/command-help). If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.