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

keypath: fix incorrect key #9133

Merged
merged 2 commits into from
Mar 11, 2025
Merged

keypath: fix incorrect key #9133

merged 2 commits into from
Mar 11, 2025

Conversation

okJiang
Copy link
Member

@okJiang okJiang commented Mar 11, 2025

What problem does this PR solve?

Issue Number: Close #9132

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test

ref #9131

Release note

None.

Copy link
Contributor

ti-chi-bot bot commented Mar 11, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added dco-signoff: yes Indicates the PR's author has signed the dco. release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Mar 11, 2025
@okJiang okJiang marked this pull request as ready for review March 11, 2025 07:29
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Mar 11, 2025
Comment on lines 218 to 220
// NOTE: schedulerConfigPathPrefix is "/pd/{cluster_id}/scheduler_config" before.
// Now it is "/pd/{cluster_id}/scheduler_config/". I think This has no impact.
// If it needs to be fixed, I can update it.
Copy link
Member Author

Choose a reason for hiding this comment

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

These comment will be removed after review

Copy link
Member

Choose a reason for hiding this comment

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

I think it's best to remain consistent with what it was before.

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

Copy link
Member Author

Choose a reason for hiding this comment

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

The previous commit had issues, so I submitted a new one. 6b83724

@okJiang
Copy link
Member Author

okJiang commented Mar 11, 2025

/retest

Comment on lines 218 to 220
// NOTE: schedulerConfigPathPrefix is "/pd/{cluster_id}/scheduler_config" before.
// Now it is "/pd/{cluster_id}/scheduler_config/". I think This has no impact.
// If it needs to be fixed, I can update it.
Copy link
Member

Choose a reason for hiding this comment

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

I think it's best to remain consistent with what it was before.

@@ -238,6 +238,9 @@ func (rw *Watcher) initializeRegionLabelWatcher() error {
rw.labelWatcher = etcdutil.NewLoopWatcher(
rw.ctx, &rw.wg,
rw.etcdClient,
// NOTE: regionLabelPathPrefix is "/pd/{cluster_id}/region_label" before.
// Now it is "/pd/{cluster_id}/region_label/". I think This has no impact.
// If it needs to be fixed, I can update it.
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

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.33%. Comparing base (bdd857e) to head (6b83724).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9133      +/-   ##
==========================================
+ Coverage   76.31%   76.33%   +0.02%     
==========================================
  Files         473      473              
  Lines       71975    71981       +6     
==========================================
+ Hits        54926    54946      +20     
+ Misses      13612    13591      -21     
- Partials     3437     3444       +7     
Flag Coverage Δ
unittests 76.33% <100.00%> (+0.02%) ⬆️

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -109,15 +109,15 @@ func (suite *keyspaceGroupManagerTestSuite) TestDeletedGroupCleanup() {
suite.applyEtcdEvents(re, []*etcdEvent{generateKeyspaceGroupPutEvent(1, []uint32{1}, []string{svcAddr})})
// Check if the TSO key is created.
testutil.Eventually(re, func() bool {
ts, err := mgr.storage.LoadTimestamp(keypath.Prefix(keypath.TimestampPath(1)))
ts, err := mgr.storage.LoadTimestamp(keypath.TimestampPath(1))
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 add some other test to avoid the similiar problems?

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 think #9126 will be a stronger test to avoid this.

Copy link
Member Author

@okJiang okJiang Mar 11, 2025

Choose a reason for hiding this comment

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

BTW, the reason that we do not detect the problem of LoadTimestamp is the non-timestamp key has been skipped in this. So it will not cause any actual damage. 😂

for i, key := range keys {
key := strings.TrimSpace(key)
if !strings.HasSuffix(key, "timestamp") {
continue
}

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Mar 11, 2025
Signed-off-by: okJiang <[email protected]>
@ti-chi-bot ti-chi-bot bot added the lgtm label Mar 11, 2025
Copy link
Contributor

ti-chi-bot bot commented Mar 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 11, 2025
Copy link
Contributor

ti-chi-bot bot commented Mar 11, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-03-11 08:02:44.943685445 +0000 UTC m=+256520.549214376: ☑️ agreed by lhy1024.
  • 2025-03-11 09:41:09.065166372 +0000 UTC m=+262424.670695298: ☑️ agreed by JmPotato.

@ti-chi-bot ti-chi-bot bot merged commit 2c5510c into tikv:master Mar 11, 2025
25 checks passed
@okJiang okJiang deleted the fix-key-path branch March 11, 2025 09:57
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-9.0-beta.1: #9136.

ti-chi-bot bot pushed a commit that referenced this pull request Mar 13, 2025
close #9132

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

Co-authored-by: okJiang <[email protected]>
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 needs-cherry-pick-release-9.0-beta.1 release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The etcd key has been modified incorrectly.
4 participants