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

raftstore-v2: clean up import sst file only if flushed epoch is stale. #15064

Merged
merged 17 commits into from Jul 11, 2023

Conversation

bufferflies
Copy link
Contributor

@bufferflies bufferflies commented Jul 4, 2023

What is changed and how it works?

Issue Number: Close #15018

What's Changed:

1.  delete sst by using flushed epoch  not raft epoch to avoid replay this log(flushed epoch is the epoch in raft enginem, which is related with flushed admin index)
2. delete sst divide into two place:
   a. cf flush, the cf flushed index is bigger than the sst applied index 
   b. CleanUpSstTick, the sst epoch is stable than the flushed epoch. 

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

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

Side effects

Release note

raftstore-v2: clean up import sst file only if flushed epoch is stale.

Signed-off-by: bufferflies <1045931706@qq.com>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 4, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • SpadeA-Tang
  • overvenus

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
components/engine_traits/src/flush.rs Outdated Show resolved Hide resolved
components/raftstore-v2/src/raft/storage.rs Outdated Show resolved Hide resolved
components/raftstore-v2/src/operation/ready/snapshot.rs Outdated Show resolved Hide resolved
components/raftstore-v2/src/operation/ready/apply_trace.rs Outdated Show resolved Hide resolved
Signed-off-by: bufferflies <1045931706@qq.com>
@ti-chi-bot ti-chi-bot bot removed the needs-rebase label Jul 5, 2023
@@ -183,6 +199,7 @@ impl<EK: KvEngine, ER: RaftEngine> Storage<EK, ER> {
gen_snap_task: RefCell::new(Box::new(None)),
split_init: None,
apply_trace,
flushed_epoch: epoch,
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems this epoch is the newly epoch and irrelevant with flush.
Will it delete the file before ingest replayed after restart?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Q1: epoch refresh only if trace.admin.index has writed in the disk.
Q2: sst will be delete if the sst's epoch is stale than the flush epoch

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Status: PR - There is already 1 approval label Jul 7, 2023
@bufferflies
Copy link
Contributor Author

/ping @overvenus @3pointer

@ti-chi-bot ti-chi-bot bot added status/LGT2 Status: PR - There are already 2 approvals and removed status/LGT1 Status: PR - There is already 1 approval labels Jul 10, 2023
Signed-off-by: bufferflies <1045931706@qq.com>
@pingyu
Copy link
Contributor

pingyu commented Jul 11, 2023

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 11, 2023

@pingyu: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 11, 2023

This pull request has been accepted and is ready to merge.

Commit hash: 725351a

@ti-chi-bot ti-chi-bot bot added the status/can-merge Status: Can merge to base branch label Jul 11, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 11, 2023

@bufferflies: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@bufferflies
Copy link
Contributor Author

/test

@ti-chi-bot ti-chi-bot bot merged commit 1d60d57 into tikv:master Jul 11, 2023
7 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Jul 11, 2023
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request Jul 11, 2023
close tikv#15018

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@bufferflies bufferflies deleted the delete_sst branch August 29, 2023 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-7.1 release-note size/XL status/can-merge Status: Can merge to base branch status/LGT2 Status: PR - There are already 2 approvals
Projects
None yet
6 participants