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

pkg/lightning: fix chunk restore may ignore error if ctx is canceled (#873) #874

Merged
merged 3 commits into from Mar 18, 2021

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Mar 15, 2021

cherry-pick #873 to release-4.0
You can switch your code base to this Pull Request by using git-extras:

# In br repo:
git pr https://github.com/pingcap/br/pull/874

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/br.git pr/874:release-4.0-1a00477da3b3

What problem does this PR solve?

Fix the bug that lightning may ignore context cancel error and lose data.
Close #855.

What is changed and how it works?

In the failed lightning_checkpoint_chunks integrations tests, there are logs as follows:

[2021-03-13T13:05:59.989Z] [2021/03/13 21:05:39.395 +08:00] [INFO] [restore.go:2553] ["restore file completed"] [table=`cpch_tsr`.`tbl`] [engineNumber=0] [fileIndex=3] [path=cpch_tsr.tbl.4.sql:0] [readDur=1.161606ms] [encodeDur=2.307684ms] [deliverDur=0s] [checksum="{cksum=0,size=0,kvs=0}"] [takeTime=4.021432ms] []

Note the deliverDuris 0, this means thedeliverResult` is an object with the default parameter which is caused by reading from a closed channel.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release Note

  • Fix a bug that chunk restore task may ignore context cancel error and causes data loss.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@kennytm
Copy link
Collaborator

kennytm commented Mar 15, 2021

/lgtm

@ti-srebot ti-srebot added the status/LGT1 LGTM1 label Mar 15, 2021
@overvenus
Copy link
Member

LGTM

@ti-srebot ti-srebot added status/LGT2 LGTM2 and removed status/LGT1 LGTM1 labels Mar 16, 2021
@glorv
Copy link
Collaborator

glorv commented Mar 17, 2021

/merge

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@ti-srebot merge failed.

@glorv
Copy link
Collaborator

glorv commented Mar 17, 2021

/merge

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@ti-srebot merge failed.

@glorv
Copy link
Collaborator

glorv commented Mar 18, 2021

/merge

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot added status/LGT3 LGTM3. This PR looks very good to our bot. and removed status/LGT2 LGTM2 labels Mar 18, 2021
@glorv glorv merged commit aabd56e into pingcap:release-4.0 Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants