Skip to content

encryption: add test for temporary KMS service unavailable#17445

Merged
ti-chi-bot[bot] merged 2 commits intotikv:masterfrom
hhwyt:master
Aug 28, 2024
Merged

encryption: add test for temporary KMS service unavailable#17445
ti-chi-bot[bot] merged 2 commits intotikv:masterfrom
hhwyt:master

Conversation

@hhwyt
Copy link
Contributor

@hhwyt hhwyt commented Aug 27, 2024

ref #17410

This commit adds a new test to verify TiKV's recovery after temporary unavailability of the KMS service.

What is changed and how it works?

Issue Number: Ref #17410

What's Changed:

This commit adds a new test to verify TiKV's recovery after temporary unavailability of the KMS service.

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)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Release note

no.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. contribution This PR is from a community contributor. labels Aug 27, 2024
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 27, 2024

Hi @hhwyt. Thanks for your PR.

I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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 kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot added needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 27, 2024
@hhwyt
Copy link
Contributor Author

hhwyt commented Aug 27, 2024

/pull-unit-test

@hhwyt
Copy link
Contributor Author

hhwyt commented Aug 27, 2024

/cc @glorv @LykxSassinator @overvenus

Comment on lines 234 to 242
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
let fail = (|| {
fail_point!("kms_api_timeout_decrypt", |val| val
.and_then(|x| x.parse::<bool>().ok())
.unwrap_or(false));
false
})();
if fail {
return Err(CloudError::ApiTimeout(box_err!("api timeout")));
}
(|| {
let fail = fail_point!("kms_api_timeout_decrypt", |val| val
.and_then(|x| x.parse::<bool>().ok())
.unwrap_or(false));
if fail {
Err(CloudError::ApiTimeout(box_err!("api timeout")))
} else {
Ok(())
}
})()?;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I refactored the fail_point part to the following simplified version. Let me know if you have any thoughts or suggestions!

        fail_point!(fail_point_name, |val| {
            val.and_then(|x| x.parse::<bool>().ok())
                .filter(|&fail| fail)
                .map(|_| Err(CloudError::ApiTimeout(box_err!("api timeout"))))
                .unwrap_or(Ok(()))
        });

Comment on lines 216 to 224
Copy link
Member

Choose a reason for hiding this comment

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

See above comments.

@glorv glorv removed needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. labels Aug 27, 2024
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. and removed do-not-merge/needs-triage-completed labels Aug 27, 2024
Copy link
Contributor

@LykxSassinator LykxSassinator 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 bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Aug 28, 2024
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LykxSassinator, overvenus

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [LykxSassinator,overvenus]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the lgtm label Aug 28, 2024
@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 28, 2024
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 28, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-28 02:57:13.058067299 +0000 UTC m=+925428.192517415: ☑️ agreed by LykxSassinator.
  • 2024-08-28 04:07:44.356115709 +0000 UTC m=+929659.490565831: ☑️ agreed by overvenus.

ref tikv#17410

This commit adds a new test to verify TiKV's recovery after temporary unavailability of the KMS service.

Signed-off-by: hhwyt <[email protected]>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 28, 2024

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

Details

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.

@hhwyt
Copy link
Contributor Author

hhwyt commented Aug 28, 2024

/pull-unit-test

@hhwyt
Copy link
Contributor Author

hhwyt commented Aug 28, 2024

/retest

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 28, 2024

@hhwyt: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

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 kubernetes/test-infra repository.

@glorv
Copy link
Contributor

glorv commented Aug 28, 2024

/retest

@ti-chi-bot ti-chi-bot bot merged commit 222e0a4 into tikv:master Aug 28, 2024
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Aug 28, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request Aug 28, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request Aug 28, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request Aug 28, 2024
@ti-chi-bot
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved contribution This PR is from a community contributor. dco-signoff: yes Indicates the PR's author has signed the dco. lgtm needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants