Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pd_client: reduce store heartbeat retires to prevent heartbeat storm (#15191) #15230

Open
wants to merge 1 commit into
base: release-6.1
Choose a base branch
from

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #15191

What is changed and how it works?

Issue Number: Close #15184
ref tikv/pd#6556

What's Changed:

The store heartbeat will report periodically, no need to do retires
- do not retry the store heartbeat
- change `remain_reconnect_count` as `remain_request_count`
- fix some metrics

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Env

add a fail point sleep(4s) in pd server when handle the store_heartbeat, run cluster:

tiup playground v7.1.0  --tiflash=0 --pd.binpath=./pd-server-failpoint --kv.binpath=./tikv-server-fix

before:

we can see:
image
and the logs like:

[2023/07/24 17:14:37.755 +08:00] [ERROR] [util.rs:462] ["request failed, retry"] [err_code=KV:Pd:Grpc] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]
[2023/07/24 17:14:38.025 +08:00] [INFO] [util.rs:604] ["connecting to PD endpoint"] [endpoints=http://127.0.0.1:2379]
[2023/07/24 17:14:38.026 +08:00] [INFO] [util.rs:604] ["connecting to PD endpoint"] [endpoints=http://127.0.0.1:2379]
[2023/07/24 17:14:38.027 +08:00] [INFO] [util.rs:769] ["connected to PD member"] [endpoints=http://127.0.0.1:2379]
[2023/07/24 17:14:38.027 +08:00] [INFO] [util.rs:225] ["heartbeat sender and receiver are stale, refreshing ..."]
[2023/07/24 17:14:38.027 +08:00] [INFO] [util.rs:238] ["buckets sender and receiver are stale, refreshing ..."]
[2023/07/24 17:14:38.027 +08:00] [INFO] [util.rs:266] ["update pd client"] [via=] [leader=http://127.0.0.1:2379] [prev_via=] [prev_leader=http://127.0.0.1:2379]
[2023/07/24 17:14:38.027 +08:00] [INFO] [util.rs:400] ["trying to update PD client done"] [spend=2.380167ms]
...

after

Will no retry from the metrics:
image
image

[2023/07/25 11:11:21.453 +08:00] [WARN] [endpoint.rs:828] [error-response] [err="Region error (will back off and retry) message: \"EpochNotMatch current epoch of region 22 is conf_ver: 1 version: 53, but you sent conf_ver: 1 version: 52\" epoch_not_match { current_regions { id: 22 start_key: 7480000000000000FF5600000000000000F8 end_key: 748000FFFFFFFFFFFFF900000000000000F8 region_epoch { conf_ver: 1 version: 53 } peers { id: 23 store_id: 1 } } current_regions { id: 106 start_key: 7480000000000000FF5400000000000000F8 end_key: 7480000000000000FF5600000000000000F8 region_epoch { conf_ver: 1 version: 53 } peers { id: 107 store_id: 1 } } }"]
[2023/07/25 11:11:21.455 +08:00] [WARN] [endpoint.rs:828] [error-response] [err="Region error (will back off and retry) message: \"EpochNotMatch current epoch of region 22 is conf_ver: 1 version: 53, but you sent conf_ver: 1 version: 52\" epoch_not_match { current_regions { id: 22 start_key: 7480000000000000FF5600000000000000F8 end_key: 748000FFFFFFFFFFFFF900000000000000F8 region_epoch { conf_ver: 1 version: 53 } peers { id: 23 store_id: 1 } } current_regions { id: 106 start_key: 7480000000000000FF5400000000000000F8 end_key: 7480000000000000FF5600000000000000F8 region_epoch { conf_ver: 1 version: 53 } peers { id: 107 store_id: 1 } } }"]
[2023/07/25 11:11:23.473 +08:00] [ERROR] [pd.rs:1457] ["store heartbeat failed"] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]
[2023/07/25 11:11:33.476 +08:00] [ERROR] [pd.rs:1457] ["store heartbeat failed"] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]
[2023/07/25 11:11:43.482 +08:00] [ERROR] [pd.rs:1457] ["store heartbeat failed"] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]
[2023/07/25 11:11:53.482 +08:00] [ERROR] [pd.rs:1457] ["store heartbeat failed"] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]
[2023/07/25 11:12:03.488 +08:00] [ERROR] [pd.rs:1457] ["store heartbeat failed"] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]
[2023/07/25 11:12:13.485 +08:00] [ERROR] [pd.rs:1457] ["store heartbeat failed"] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]
[2023/07/25 11:12:23.493 +08:00] [ERROR] [pd.rs:1457] ["store heartbeat failed"] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]
[2023/07/25 11:12:33.494 +08:00] [ERROR] [pd.rs:1457] ["store heartbeat failed"] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]
[2023/07/25 11:12:43.496 +08:00] [ERROR] [pd.rs:1457] ["store heartbeat failed"] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]
[2023/07/25 11:12:53.497 +08:00] [ERROR] [pd.rs:1457] ["store heartbeat failed"] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]
[2023/07/25 11:13:03.500 +08:00] [ERROR] [pd.rs:1457] ["store heartbeat failed"] [err="Grpc(RpcFailure(RpcStatus { code: 4-DEADLINE_EXCEEDED, message: \"Deadline Exceeded\", details: [] }))"]

Release note

pd_client: reduce store heartbeat retires to prevent heartbeat storm

ref tikv/pd#6556, close tikv#15184

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 28, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • HuSharp

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 28, 2023

This cherry pick PR is for a release branch and has not yet been approved by release team.
Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick, it must first be approved by the collaborators.

AFTER it has been approved by collaborators, please ping the release team in a comment to request a cherry pick review.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Status: PR - There is already 1 approval label Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants