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) #8527

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.3 labels Aug 14, 2024
@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 77.41%. Comparing base (1c1cd99) to head (4840dd5).

Additional details and impacted files
@@             Coverage Diff              @@
##           release-8.3    #8527   +/-   ##
============================================
  Coverage        77.40%   77.41%           
============================================
  Files              473      473           
  Lines            61934    61933    -1     
============================================
+ Hits             47941    47943    +2     
- Misses           10409    10416    +7     
+ Partials          3584     3574   -10     
Flag Coverage Δ
unittests 77.41% <50.00%> (+<0.01%) ⬆️

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

Copy link
Contributor

ti-chi-bot bot commented Aug 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HuSharp, 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 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 248206b into tikv:release-8.3 Aug 14, 2024
21 of 23 checks passed
@HuSharp HuSharp deleted the cherry-pick-8523-to-release-8.3 branch August 14, 2024 06:39
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.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants