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

*: remove api mode concept #8952

Merged
merged 7 commits into from
Jan 7, 2025
Merged

*: remove api mode concept #8952

merged 7 commits into from
Jan 7, 2025

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Dec 27, 2024

What problem does this PR solve?

Issue Number: ref #8477

What is changed and how does it work?

This PR changes the following things:

  • rename pdService* to service* in client, pd service can be used only in microservice mode.
  • merge apiSvc* and pdSvc* in client and change the name to service*
  • use pd mode and pd service mode to distinguish whether PD is in microservice mode, previously we use api*
  • rename all tests and comments to adapt the above changes

Check List

Tests

  • Unit test

Release note

None.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 27, 2024
@rleungx rleungx force-pushed the rename-api branch 2 times, most recently from cb81d98 to 806f172 Compare December 27, 2024 05:39
@rleungx rleungx force-pushed the rename-api branch 4 times, most recently from 3c8d130 to b2765f0 Compare December 27, 2024 05:47
@rleungx rleungx requested review from lhy1024 and okJiang and removed request for lhy1024 December 30, 2024 10:03
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

Attention: Patch coverage is 81.38298% with 35 lines in your changes missing coverage. Please review.

Project coverage is 76.34%. Comparing base (75cdec4) to head (3cda7ab).
Report is 1098 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8952      +/-   ##
==========================================
+ Coverage   74.91%   76.34%   +1.42%     
==========================================
  Files         416      465      +49     
  Lines       42103    70550   +28447     
==========================================
+ Hits        31543    53859   +22316     
- Misses       7810    13344    +5534     
- Partials     2750     3347     +597     
Flag Coverage Δ
unittests 76.34% <81.38%> (+1.42%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 31, 2024
@rleungx
Copy link
Member Author

rleungx commented Jan 2, 2025

/retest

Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -116,7 +116,7 @@ func MicroserviceRedirectRule(matchPath, targetPath, targetServiceName string,
}

func (h *redirector) matchMicroServiceRedirectRules(r *http.Request) (bool, string) {
if !h.s.IsAPIServiceMode() {
if !h.s.IsPDServiceMode() {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about IsMicroServiceMode?

Copy link
Member Author

Choose a reason for hiding this comment

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

See the PR description.

@@ -220,7 +220,7 @@ func (s *Server) updateAPIServerMemberLoop() {
// double check
break
}
if s.cluster.SwitchAPIServerLeader(pdpb.NewPDClient(cc)) {
if s.cluster.SwitchPDLeader(pdpb.NewPDClient(cc)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about SwitchPDServiceLeader

Copy link
Member Author

Choose a reason for hiding this comment

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

done

// flagFromAPIServer has no influence for pd mode, but it is useful for us to debug in api mode.
flagFromAPIServer = "from_api_server"
// flagFromPDService has no influence for pd mode, but it is useful for us to debug in pd service mode.
flagFromPDService = "from_api_server"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to change "from_api_server"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't change it before because I'm afraid there is a compatibility issue. Since it is not GA now, I'm going to change it.

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 6, 2025
Copy link
Contributor

ti-chi-bot bot commented Jan 6, 2025

[LGTM Timeline notifier]

Timeline:

  • 2024-12-31 08:59:15.259886632 +0000 UTC m=+427290.615891172: ☑️ agreed by okJiang.
  • 2025-01-06 03:56:49.156647596 +0000 UTC m=+153152.445479300: ☑️ agreed by lhy1024.

@rleungx
Copy link
Member Author

rleungx commented Jan 6, 2025

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 6, 2025
@rleungx
Copy link
Member Author

rleungx commented Jan 6, 2025

@lhy1024 @okJiang @JmPotato I also made some changes to the client package. PTAL

@rleungx
Copy link
Member Author

rleungx commented Jan 6, 2025

@niubell PTAL

@rleungx
Copy link
Member Author

rleungx commented Jan 6, 2025

/retest

Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
@rleungx
Copy link
Member Author

rleungx commented Jan 7, 2025

/retest

Copy link
Contributor

ti-chi-bot bot commented Jan 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato, lhy1024, niubell, okJiang

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:

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 ti-chi-bot bot added the approved label Jan 7, 2025
@rleungx
Copy link
Member Author

rleungx commented Jan 7, 2025

/retest

@rleungx
Copy link
Member Author

rleungx commented Jan 7, 2025

/hold cancel

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 7, 2025
@ti-chi-bot ti-chi-bot bot merged commit 973234d into tikv:master Jan 7, 2025
25 checks passed
@rleungx rleungx deleted the rename-api branch January 7, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants