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: fix an invalid err != nil check (#8523) #8525

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #8523

What problem does this PR solve?

Issue Number: close #8524.

var mergedTS time.Time
for _, id := range mergeList {
ts, err := kgm.tsoSvcStorage.LoadTimestamp(endpoint.KeyspaceGroupGlobalTSPath(id))
if err != nil {
log.Error("failed to load the keyspace group TSO",
zap.String("member", kgm.tsoServiceID.ServiceAddr),
zap.Uint32("merge-target-id", mergeTargetID),
zap.Any("merge-list", mergeList),
zap.Uint32("merge-id", id),
zap.Time("ts", ts),
zap.Error(err))
break
}
if ts.After(mergedTS) {
mergedTS = ts
}
}
if err != nil {
continue
}

Since the err in the loop is a local variable, so the check at line 1382 will always be false before this fix.

What is changed and how does it work?

Use the continue label to retry the whole merge loop correctly.

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
@ti-chi-bot ti-chi-bot added approved component/keyspace Key space. component/tso Timestamp Oracle. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-8.1 This PR is cherry-picked to release-8.1 from a source PR. labels Aug 14, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato

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 Aug 14, 2024
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 73.76%. Comparing base (10ecdbe) to head (689a480).

Additional details and impacted files
@@               Coverage Diff               @@
##           release-8.1    #8525      +/-   ##
===============================================
+ Coverage        73.67%   73.76%   +0.08%     
===============================================
  Files              437      437              
  Lines            48750    48749       -1     
===============================================
+ Hits             35918    35960      +42     
+ Misses            9772     9735      -37     
+ Partials          3060     3054       -6     
Flag Coverage Δ
unittests 73.76% <50.00%> (+0.08%) ⬆️

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

@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Aug 14, 2024
@ti-chi-bot ti-chi-bot bot merged commit f3dd0b6 into tikv:release-8.1 Aug 14, 2024
23 of 26 checks passed
@JmPotato JmPotato deleted the cherry-pick-8523-to-release-8.1 branch August 14, 2024 05:44
@lhy1024
Copy link
Contributor

lhy1024 commented Aug 14, 2024

Do we need to pick it to release-8.3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. component/keyspace Key space. component/tso Timestamp Oracle. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-8.1 This PR is cherry-picked to release-8.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants