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

log_backup: fix panic during advancer owner transfer #52671

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

YuJuncen
Copy link
Contributor

@YuJuncen YuJuncen commented Apr 17, 2024

What problem does this PR solve?

Issue Number: close #52597

Problem Summary:

  1. When losing the advancer ownership, the channel for subscription may be full.
  2. the consumer has already gone due to the canceled context. Hence making the producer(subscription) goroutine stuck.
  3. After the graceful shutdown period, the output channel will be eventually closed and we will get a send on closed channel panic.

What changed and how does it work?

  • When sending to the channel, also select the context.
  • Catch all panic and convert them to errors (so we can retry.)

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

Fixed a bug where TiDB may panic when log backup enabled and PD is unreachable.

Signed-off-by: hillium <yu745514916@live.com>
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/needs-triage-completed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 17, 2024
Copy link

tiprow bot commented Apr 17, 2024

Hi @YuJuncen. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Signed-off-by: hillium <yu745514916@live.com>
Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Merging #52671 (714aac5) into master (224ae15) will increase coverage by 1.2194%.
Report is 25 commits behind head on master.
The diff coverage is 95.5555%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52671        +/-   ##
================================================
+ Coverage   74.3558%   75.5752%   +1.2194%     
================================================
  Files          1470       1474         +4     
  Lines        354521     436242     +81721     
================================================
+ Hits         263607     329691     +66084     
- Misses        71638      85939     +14301     
- Partials      19276      20612      +1336     
Flag Coverage Δ
integration 50.4641% <13.3333%> (?)
unit 71.2466% <95.5555%> (-1.8806%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 61.4963% <95.5555%> (+18.8564%) ⬆️

@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Apr 18, 2024
Signed-off-by: hillium <yu745514916@live.com>
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 18, 2024
Copy link

ti-chi-bot bot commented Apr 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3pointer, Leavrth

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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 18, 2024
Copy link

ti-chi-bot bot commented Apr 18, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-18 03:36:36.679597801 +0000 UTC m=+482015.790644248: ☑️ agreed by Leavrth.
  • 2024-04-18 04:06:51.365669359 +0000 UTC m=+483830.476715802: ☑️ agreed by 3pointer.

@Leavrth
Copy link
Contributor

Leavrth commented Apr 18, 2024

/retest

Copy link

tiprow bot commented Apr 18, 2024

@Leavrth: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Leavrth
Copy link
Contributor

Leavrth commented Apr 18, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Apr 18, 2024
@BornChanger
Copy link
Contributor

/retest

@ti-chi-bot ti-chi-bot bot merged commit f01f305 into pingcap:master Apr 18, 2024
35 of 40 checks passed
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Apr 18, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #52713.

@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label May 7, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 7, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #53060.

@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. label May 31, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 31, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #53703.

@YuJuncen YuJuncen added affects-8.1 needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. and removed affects-8.1 labels Jul 18, 2024
@YuJuncen
Copy link
Contributor Author

/run-cherry-picker

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #54708.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 18, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

tidb panic after inject one of AZ network partition with pitr running
5 participants