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

server: Support explicitly getting health feedback information by calling RPC #17008

Merged
merged 12 commits into from
May 16, 2024

Conversation

MyonKeminta
Copy link
Contributor

@MyonKeminta MyonKeminta commented May 13, 2024

What is changed and how it works?

Issue Number: Close #16297

What's Changed:

This PR makes TiKV support explicitly getting health feedback information by calling RPC. Both non-batched mode and batched mode (using BatchCommands stream) are supported.
There's some special behavior when used in batched RPC mode: The BatchCommandsResponse that contains the response of getting health feedback will always have feedback information attached (in the same way as how it's attached without being explicitly requested), and the attached information and the information carried in each single GetHealthFeedbackResponse-s is the same.

Related changes

Check List

Tests

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

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Release note

None

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Copy link
Contributor

ti-chi-bot bot commented May 13, 2024

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • cfzjywxk
  • ekexium

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.

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta
Copy link
Contributor Author

cc @crazycs520 PTAL thanks!

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Comment on lines +2619 to +2621
if requested_feedback.is_none() {
requested_feedback = Some(self.gen_health_feedback_pb());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When will this logic be used?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is explicit health fetch request in the batch commands I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make it a complete API, GetHealthFeedbackResponse carries the health feedback information. We don't actually use it for now, but it makes further potential uses possible. When it's used in batch_commands, the feedback information will also be attached to the BatchCommandsResponse, so that it can be easily handled by the batch client, and it's transparent to the batch client whether the feedback is periodically sent or explicitly requested.
Here the code is used to check a BatchCommandsResponse, and attach the information if explicitly requested (by checking whether there is one or more GetHealthFeedbackResponse).

Copy link
Collaborator

@cfzjywxk cfzjywxk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -1042,7 +1042,9 @@ impl<E: Engine, L: LockManager, F: KvFormat> Tikv for Service<E, L, F> {
GRPC_RESP_BATCH_COMMANDS_SIZE.observe(r.request_ids.len() as f64);
// TODO: per thread load is more reasonable for batching.
r.set_transport_layer_load(grpc_thread_load.total_load() as u64);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated blank lines?

Comment on lines +2619 to +2621
if requested_feedback.is_none() {
requested_feedback = Some(self.gen_health_feedback_pb());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is explicit health fetch request in the batch commands I think.

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Status: PR - There is already 1 approval label May 14, 2024
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Copy link
Contributor

ti-chi-bot bot commented May 15, 2024

@crazycs520: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

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.

Copy link
Contributor

ti-chi-bot bot commented May 15, 2024

@crazycs520: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

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.

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@ti-chi-bot ti-chi-bot bot added status/LGT2 Status: PR - There are already 2 approvals and removed status/LGT1 Status: PR - There is already 1 approval labels May 16, 2024
@MyonKeminta
Copy link
Contributor Author

/merge

Copy link
Contributor

ti-chi-bot bot commented May 16, 2024

@MyonKeminta: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

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.

Copy link
Contributor

ti-chi-bot bot commented May 16, 2024

This pull request has been accepted and is ready to merge.

Commit hash: cb9e4f4

@ti-chi-bot ti-chi-bot bot added the status/can-merge Status: Can merge to base branch label May 16, 2024
@ti-chi-bot ti-chi-bot bot merged commit 2a865bb into tikv:master May 16, 2024
4 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone May 16, 2024
@MyonKeminta MyonKeminta deleted the m/support-request-health-feedback branch May 16, 2024 06:54
@MyonKeminta
Copy link
Contributor Author

/release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none size/L status/can-merge Status: Can merge to base branch status/LGT2 Status: PR - There are already 2 approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance/health feedback to client and the Unified Health Controller
4 participants