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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVEMENT] Reject the last replica deletion if its volume.spec.deletionTimestamp is not set #7372

Closed
derekbit opened this issue Dec 18, 2023 · 2 comments
Assignees
Labels
area/resilience System or volume resilience area/stability System or volume stability area/webook Kubernetes validation and mutating webhooks backport/1.4.5 backport/1.5.4 kind/improvement Request for improvement of existing function priority/0 Must be fixed in this release (managed by PO) require/auto-e2e-test Require adding/updating auto e2e test cases if they can be automated require/backport Require backport. Only used when the specific versions to backport have not been definied. require/doc Require updating the longhorn.io documentation
Milestone

Comments

@derekbit
Copy link
Member

Is your improvement request related to a feature? Please describe (馃憤 if you like this request)

To prevent accidentally from deleting the last replica regardless of it is healthy or faulty, reject the last replica deletion if spec.deletionTimestamp of its volume is not set in the validating webhook.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

@derekbit derekbit added priority/0 Must be fixed in this release (managed by PO) require/auto-e2e-test Require adding/updating auto e2e test cases if they can be automated require/doc Require updating the longhorn.io documentation kind/improvement Request for improvement of existing function area/webook Kubernetes validation and mutating webhooks area/resilience System or volume resilience require/backport Require backport. Only used when the specific versions to backport have not been definied. labels Dec 18, 2023
@derekbit derekbit self-assigned this Dec 21, 2023
@derekbit derekbit added this to the v1.6.0 milestone Dec 21, 2023
@longhorn-io-github-bot
Copy link

longhorn-io-github-bot commented Dec 21, 2023

Pre Ready-For-Testing Checklist

  • Where is the reproduce steps/test steps documented?
    The reproduce steps/test steps are at:

Create a volume with 3 replicas.
Delete first replica and second replica. When deleting the third replica, the deletion should be rejected.

  • Does the PR include the explanation for the fix or the feature?

  • Does the PR include deployment change (YAML/Chart)? If so, where are the PRs for both YAML file and Chart?
    The PR for the YAML change is at:
    The PR for the chart change is at:

  • Have the backend code been merged (Manager, Engine, Instance Manager, BackupStore etc) (including backport-needed/*)?
    The PR is at

longhorn/longhorn-manager#2395

  • Which areas/issues this PR might have potential impacts on?
    Area: volume, replica
    Issues

@yangchiu
Copy link
Member

Verified passed on master-head (longhorn-manager 859d438) following test steps. Try to remove the last replica, error message shown:

failed to remove replica: no other healthy replica available, cannot delete replica test-1-r-b9d4c389 since it may still contain data for recovery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resilience System or volume resilience area/stability System or volume stability area/webook Kubernetes validation and mutating webhooks backport/1.4.5 backport/1.5.4 kind/improvement Request for improvement of existing function priority/0 Must be fixed in this release (managed by PO) require/auto-e2e-test Require adding/updating auto e2e test cases if they can be automated require/backport Require backport. Only used when the specific versions to backport have not been definied. require/doc Require updating the longhorn.io documentation
Projects
None yet
Development

No branches or pull requests

4 participants