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
trace peers' availability info on leader side #13209
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
279afb3
to
de1d226
Compare
de1d226
to
68246b2
Compare
What's the purpose of this PR? |
It'll be used to judge pending peer: whose (except witness) apply index is smaller than leader's truncated index |
Why it has to be apply index? Why can't matched be used? What's the exact definition and purpose of pending peer? |
|
Instead of querying index, I suggest to reply with the exact information that whether it's applying snapshot or whether it's in healthy state that can serve at least stale read.
Index less than truncated index doesn't mean it's slow. Leader is free to truncate logs whenever it wants despite other peers' apply progress. Slow apply should be monitored by time. The requirement is false.
pre-transfer-leader doesn't just check for apply index. A message is always required. |
I don't think exact information is general enough, what if we want to do flow control based on slow apply, it still needs to trace apply index progress.
Yes, it may be false-positive when compared to the truncated index, but it can compare to the leader's apply index.
I know, but it can be a quick return when the apply index is lagged. |
Slow apply should not be measured by index. Instead, it should be measured by memory, CPU and disk capacity/IO. Only the follower knows whether it's overloaded and suggest leader to do a flow control. We already have such control by actively reject leader's MsgAppend.
What's the point? They are doing different work and have different access pattern. |
Not want to deep into the details of slow apply. My point is the apply index fits the witness requirement, and it also can be used by other features. So why bother to pass exact information dedicated to witness instead of a general one -- apply index?
The point is that the slow Tiflash can be detected by the tiflash peer's apply index with leader apply index, it's not a false requirement. This issue of tiflash isn't related with time, it needs to know the index to check if the tiflash is ready, see https://pingcap.feishu.cn/docx/doxcnxQfXMgxnLV0pQqNxP9mQad |
ref tikv#12876 Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
/run-tests |
1 similar comment
/run-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
ref tikv#12876 Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
990c3e3
to
22ddaf5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any test case?
Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
I've added integration tests here because currently there is no place for these functions to be called in this PR. |
/merge |
@Connor1996: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. 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 ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 4ee908a
|
@ethercflow: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests 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. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
ref tikv#12876 Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Issue Number: ref #12876
Signed-off-by: Wenbo Zhang ethercflow@gmail.com
What is changed and how it works?
Issue Number: Close #xxx
What's Changed:
Related changes
Check List
Tests
Side effects
Release note