Skip to content

Remove useless StorageDebugging & move mock applying snapshot functions together (#1666)#1769

Merged
ti-srebot merged 6 commits intopingcap:release-4.0from
ti-srebot:release-4.0-256c9b197216
Apr 20, 2021
Merged

Remove useless StorageDebugging & move mock applying snapshot functions together (#1666)#1769
ti-srebot merged 6 commits intopingcap:release-4.0from
ti-srebot:release-4.0-256c9b197216

Conversation

@ti-srebot
Copy link
Copy Markdown
Collaborator

@ti-srebot ti-srebot commented Apr 13, 2021

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

# In tics repo:
git pr https://github.com/pingcap/tics/pull/1769

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

git push git@github.com:ti-srebot/tics.git pr/1769:release-4.0-256c9b197216

What problem does this PR solve?

This is a PR extracted from #1439.
Extract this PR for easier for reviewing and cherry-pick to release-4.0/release-5.0 branch.

What is changed and how it works?

There are 4 independent changes in this PR, you may check every single commit to better know why that piece of code is changed.
Now merging a PR is expensive (two hours at least, an hour to build and another hour to run the test), and these changes do not involve the logic in the production environment, so I merge these changes into one PR.

  1. Before this PR, we use StorageDebugging for testing delta-merge-test/raft/bugs/FLASH-484.test. But now we have FailPoints and we can elegantly test the case.

  2. Before this PR, debug functions of applying snapshot / pre-applying snapshot are written in different files, making it hard to reuse codes. This PR moves them to dbgFuncMockRaftSnapshot.cpp and aligns the style of naming.

  3. Add test cases for writing raft logs / applying snapshot when the storage is tombstoned.

  4. Fix TiFlash panic during br restore #1691 for a more complicated situation

    1. Apply a snapshot with write cf only
    2. Apply a normal snapshot
      When we applying the normal snapshot, we will try to flush current data into storage and get an exception because there is only write cf. We should also ignore that exception.

Related changes

  • Need to cherry-pick to the release branch: 4.0, 5.0

Check List

Tests

  • Integration test

Release note

  • No release note

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot ti-srebot added CHERRY-PICK cherry pick status/LGT2 Indicates that a PR has LGTM 2. type/testing Issue or PR for testing labels Apr 13, 2021
@ti-srebot ti-srebot added this to the v4.0.13 milestone Apr 13, 2021
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@JaySon-Huang
Copy link
Copy Markdown
Contributor

Merge the changes #1776 into this cherry-pick PR.

@JaySon-Huang
Copy link
Copy Markdown
Contributor

/run-all-tests

@JaySon-Huang
Copy link
Copy Markdown
Contributor

@zanmato1984 @solotzg PTAL

Copy link
Copy Markdown
Contributor

@zanmato1984 zanmato1984 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added status/LGT1 Indicates that a PR has LGTM 1. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Apr 20, 2021
@JaySon-Huang
Copy link
Copy Markdown
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 20, 2021
@ti-srebot
Copy link
Copy Markdown
Collaborator Author

/run-all-tests

@ti-srebot ti-srebot merged commit a70e771 into pingcap:release-4.0 Apr 20, 2021
@JaySon-Huang JaySon-Huang deleted the release-4.0-256c9b197216 branch April 20, 2021 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CHERRY-PICK cherry pick status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. type/testing Issue or PR for testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants