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: support encrypt backing up files #15084

Merged
merged 40 commits into from
May 7, 2024
Merged

Conversation

YuJuncen
Copy link
Contributor

@YuJuncen YuJuncen commented Jul 6, 2023

What is changed and how it works?

Issue Number: Ref #15083

What's Changed:
This PR added encryption support to the tempfiles.
Also, it implemented AsyncWrite for EncrypterWriter and DecrypterWriter.

This PR doesn't pass the Encryptor to Endpoint, hence it won't impact the behavior of TiKV for now. The connection between them will be established in next PR.

Check List

Tests

  • Unit test
  • Integration test

Release note

Now, temporary files generated by log backup will be encrypted when encryption is enabled.

YuJuncen and others added 28 commits April 24, 2023 10:10
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 6, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer
  • Leavrth

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.

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Status: PR - There is already 1 approval label Apr 9, 2024
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
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.

rest LGTM

components/encryption/src/io.rs Show resolved Hide resolved
@@ -514,6 +612,15 @@ impl CrypterCore {
}

pub fn do_crypter(&mut self, buf: &[u8]) -> IoResult<&[u8]> {
assert_eq!(
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe debug_assert_eq!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If this happens in a production cluster, the data will be corrupted. I think panic here instead will be better than writing wrong data.

@YuJuncen YuJuncen requested a review from 3pointer April 29, 2024 03:40
@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 Apr 29, 2024
@YuJuncen
Copy link
Contributor Author

YuJuncen commented May 6, 2024

/merge

Copy link
Contributor

ti-chi-bot bot commented May 6, 2024

@YuJuncen: 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 ti-chi-bot bot added the status/can-merge Status: Can merge to base branch label May 6, 2024
@YuJuncen
Copy link
Contributor Author

YuJuncen commented May 6, 2024

/merge cancel

@ti-chi-bot ti-chi-bot bot removed the status/can-merge Status: Can merge to base branch label May 6, 2024
@YuJuncen
Copy link
Contributor Author

YuJuncen commented May 6, 2024

/merge

Copy link
Contributor

ti-chi-bot bot commented May 6, 2024

@YuJuncen: 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.

Copy link
Contributor

ti-chi-bot bot commented May 6, 2024

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

Commit hash: 86592ad

@ti-chi-bot ti-chi-bot bot added the status/can-merge Status: Can merge to base branch label May 6, 2024
@overvenus overvenus self-requested a review May 6, 2024 06:46
Comment on lines +619 to +622
concat!(
"unreachable: try to override the encrypted content when there is pending async writing.",
"(canceled future? concurrency call to `write`?)"
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
concat!(
"unreachable: try to override the encrypted content when there is pending async writing.",
"(canceled future? concurrency call to `write`?)"
)
"unreachable: try to override the encrypted content when there is \
pending async writing. (canceled future? concurrency call to \
`write`?)"

@ti-chi-bot ti-chi-bot bot merged commit 608fc17 into tikv:master May 7, 2024
7 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note size/XXL 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.

None yet

4 participants