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 early return #13288

Merged
merged 6 commits into from Aug 16, 2022
Merged

Conversation

YuJuncen
Copy link
Contributor

@YuJuncen YuJuncen commented Aug 15, 2022

What is changed and how it works?

Issue Number: Close #13281

What's Changed:
This PR fixed a bug that may cause data loss with the satisfaction of these conditions:

  • In the initial scanning stage, if...
    • There are more than 1,024 adjacent keys are prewritten but not committed.
    • The values of these keys are all short enough to be inlined in the write CF.
      ("adjacent" means, the initial scanning cannot get any commit entries interleaving them, the DeltaScanner emits a batch with 1,024 Prewrites).
  • If there are some keys committed BEFORE the initial scanning but NOT YET have been observed, those key would be lost. (For a detailed case, check the integration test split_txn).
Fixed a bug that may cause data loss in log backup.

Related changes

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

Check List

Tests

  • Integration test
  • Manual test (add detailed scripts or steps below)
    We have tested this with 1,000 tables in sysbench oltp_write_only prepare phase.
    • with this PR, no data loss observed.
    • without this PR, there would always be data loss for some tables.

Release note

Fixed a bug that may cause PiTR losing some data when there are too many adjacent short row putting.

Signed-off-by: Yu Juncen <yu745514916@live.com>
Signed-off-by: Yu Juncen <yu745514916@live.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 15, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer
  • 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: Yu Juncen <yu745514916@live.com>
@YuJuncen
Copy link
Contributor Author

/cc @hicqu @overvenus @3pointer

Signed-off-by: Yu Juncen <yu745514916@live.com>
@@ -650,6 +665,45 @@ mod test {
suite.cluster.shutdown();
}

/// This test tests whether we can handle some weird transactions and their
Copy link
Member

Choose a reason for hiding this comment

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

How the "weird transactions" looks like? Could you add some comments?

Signed-off-by: Yu Juncen <yu745514916@live.com>
Signed-off-by: Yu Juncen <yu745514916@live.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Status: PR - There is already 1 approval label Aug 16, 2022
Copy link
Contributor

@3pointer 3pointer 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-chi-bot ti-chi-bot added status/LGT2 Status: PR - There are already 2 approvals and removed status/LGT1 Status: PR - There is already 1 approval labels Aug 16, 2022
@overvenus
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

@overvenus: 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
Member

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

Commit hash: 6b5a8c3

@ti-chi-bot ti-chi-bot added the status/can-merge Status: Can merge to base branch label Aug 16, 2022
@ti-chi-bot ti-chi-bot merged commit 73c0bac into tikv:master Aug 16, 2022
@ti-chi-bot ti-chi-bot added this to the Pool milestone Aug 16, 2022
ti-srebot pushed a commit to ti-srebot/tikv that referenced this pull request Aug 16, 2022
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-6.2 in PR #13291

ti-chi-bot pushed a commit that referenced this pull request Aug 16, 2022
close #13281, ref #13288

Fixed a bug that may cause data loss in log backup.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Signed-off-by: Yu Juncen <yu745514916@live.com>

Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
fengou1 pushed a commit to fengou1/tikv that referenced this pull request Aug 30, 2022
close tikv#13281

Fixed a bug that may cause data loss in log backup.

Signed-off-by: Yu Juncen <yu745514916@live.com>
Signed-off-by: fengou1 <feng.ou@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution Type: PR - From contributors needs-cherry-pick-release-6.2 release-note size/M status/can-merge Status: Can merge to base branch status/LGT2 Status: PR - There are already 2 approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data inconsistency after br PiTR restore
5 participants