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

tso/local: remove local tso completely #8864

Merged
merged 10 commits into from
Dec 11, 2024
Merged

Conversation

okJiang
Copy link
Member

@okJiang okJiang commented Dec 2, 2024

What problem does this PR solve?

Issue Number: Close #8802

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

Signed-off-by: okJiang <[email protected]>
@ti-chi-bot ti-chi-bot bot added 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 2, 2024
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, but ci failed

pkg/mcs/tso/server/server.go Show resolved Hide resolved
@@ -217,17 +214,6 @@ func (am *AllocatorManager) getGroupIDStr() string {
return strconv.FormatUint(uint64(am.kgID), 10)
}

// GetTimestampPath returns the timestamp path in etcd.
func (am *AllocatorManager) GetTimestampPath() string {
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Copy link
Member Author

@okJiang okJiang Dec 3, 2024

Choose a reason for hiding this comment

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

GetTimestampPath is only used to print log when created allocator manager now. I think

log.Info("created allocator manager",
		zap.Uint32("keyspace-group-id", group.ID))

is enough, do not have to know the TimestampPath.

Copy link
Member

@rleungx rleungx Dec 3, 2024

Choose a reason for hiding this comment

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

The comment is important and we also use it in the test.

Copy link
Member Author

Choose a reason for hiding this comment

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

Did you say this comment?

	// GetTimestampPath returns the timestamp path in etcd, which is:
	// 1. for the default keyspace group:
	//     a. timestamp in /pd/{cluster_id}/timestamp
	//     b. lta/{dc-location}/timestamp in /pd/{cluster_id}/lta/{dc-location}/timestamp
	// 1. for the non-default keyspace groups:
	//     a. {group}/gts/timestamp in /ms/{cluster_id}/tso/{group}/gta/timestamp
	//     b. {group}/lts/{dc-location}/timestamp in /ms/{cluster_id}/tso/{group}/lta/{dc-location}/timestamp
	GetTimestampPath() string

It is outdated. lta/{dc-location}/timestamp in /pd/{cluster_id}/lta/{dc-location}/timestamp and {group}/lts/{dc-location}/timestamp in /ms/{cluster_id}/tso/{group}/lta/{dc-location}/timestamp are removed. We can see the left in

// KeyspaceGroupGlobalTSPath constructs the timestampOracle path prefix for Global TSO, which is:
// 1. for the default keyspace group:
// "" in /pd/{cluster_id}/timestamp
// 2. for the non-default keyspace groups:
// {group}/gta in /ms/{cluster_id}/tso/{group}/gta/timestamp
func KeyspaceGroupGlobalTSPath(groupID uint32) string {
if groupID == constant.DefaultKeyspaceGroupID {
return ""
}
return path.Join(fmt.Sprintf("%05d", groupID), globalTSOAllocatorEtcdPrefix)
}

Copy link
Member

Choose a reason for hiding this comment

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

Got it. BTW, I found we still have some comments mentioning KeyspaceGroupLocalTSPath, please also remove it.

Signed-off-by: okJiang <[email protected]>
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 76.23%. Comparing base (fbfcdb8) to head (983b58a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8864      +/-   ##
==========================================
+ Coverage   76.22%   76.23%   +0.01%     
==========================================
  Files         461      461              
  Lines       70448    70395      -53     
==========================================
- Hits        53696    53664      -32     
+ Misses      13399    13383      -16     
+ Partials     3353     3348       -5     
Flag Coverage Δ
unittests 76.23% <75.00%> (+0.01%) ⬆️

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

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

okJiang commented Dec 3, 2024

/retest

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

okJiang commented Dec 9, 2024

/cc @lhy1024 @JmPotato

@ti-chi-bot ti-chi-bot bot requested review from JmPotato and lhy1024 December 9, 2024 06:39
client/client.go Outdated
Comment on lines 571 to 572
// Deprecated: Currently, regardless of the
// parameters passed in, this method will default to returning the global TSO.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Deprecated: Currently, regardless of the
// parameters passed in, this method will default to returning the global TSO.
// Deprecated: the Local TSO feature has been deprecated. Regardless of the parameters passed, the behavior of this interface will be equivalent to `GetTSAsync/GetTS`. If you want to use a separately deployed TSO service, please refer to the deployment of the TSO microservice.

client/client.go Outdated
@@ -582,7 +582,7 @@ func (c *client) GetTS(ctx context.Context) (physical int64, logical int64, err

// GetLocalTS implements the TSOClient interface.
//
// Deprecated: Local TSO will be completely removed in the future. Currently, regardless of the
// Deprecated: Currently, regardless of the
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

@okJiang
Copy link
Member Author

okJiang commented Dec 10, 2024

/retest

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

okJiang commented Dec 11, 2024

/retest

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 11, 2024
Copy link
Contributor

ti-chi-bot bot commented Dec 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-03 08:41:21.165612388 +0000 UTC m=+1144268.785266898: ☑️ agreed by rleungx.
  • 2024-12-11 06:29:15.530131654 +0000 UTC m=+419945.618934192: ☑️ agreed by JmPotato.

Copy link
Contributor

ti-chi-bot bot commented Dec 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato, niubell, 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:

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 Dec 11, 2024
@ti-chi-bot ti-chi-bot bot merged commit 5d62787 into tikv:master Dec 11, 2024
25 checks passed
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eliminate all code related to Local TSO
5 participants