Skip to content

feat: add pool decommission lifecycle#130

Merged
GatewayJ merged 1 commit into
rustfs:mainfrom
GatewayJ:codex/minio-aligned-pool-decommission
May 24, 2026
Merged

feat: add pool decommission lifecycle#130
GatewayJ merged 1 commit into
rustfs:mainfrom
GatewayJ:codex/minio-aligned-pool-decommission

Conversation

@GatewayJ
Copy link
Copy Markdown
Member

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

N/A

Summary of Changes

  • Add pool lifecycle/decommission request CRD fields, status fields, RustFS admin client support, and console API endpoints.
  • Align post-decommission pool removal with MinIO Operator behavior: after decommission completion, removing the pool from spec.pools allows the operator to remove the matching StatefulSet and emit PoolRemoved.
  • Reject stray cancel requests without an active decommission request/status, remove stale lifecycle requests when pools are removed or re-added, and keep tenants reconciling during decommission cleanup.
  • Expose pool lifecycle and decommission progress through the console API and OpenAPI/types.

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit (fmt-check + clippy + test + console-lint + console-fmt-check)
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CHANGELOG.md updated under [Unreleased] (N/A: repository does not currently contain CHANGELOG.md)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (CRD/API compatibility)
  • Requires doc/config/deployment update
  • Other impact: Adds pool lifecycle/decommission fields to the Tenant CRD and console API.

Verification

make pre-commit

Additional Notes

The cleanup flow intentionally mirrors MinIO Operator's documented flow: run decommission, wait until complete, then remove the decommissioned pool from the Tenant spec so the operator can delete the stale StatefulSet while retaining PVCs.


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

@GatewayJ GatewayJ force-pushed the codex/minio-aligned-pool-decommission branch from 4a1c55c to bcfd087 Compare May 24, 2026 09:50
@GatewayJ GatewayJ marked this pull request as ready for review May 24, 2026 10:19
@GatewayJ GatewayJ added this pull request to the merge queue May 24, 2026
Merged via the queue into rustfs:main with commit 10c7d12 May 24, 2026
2 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bcfd087a45

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +662 to +667
if info.complete.unwrap_or(false)
|| info.canceled.unwrap_or(false)
|| info.failed.unwrap_or(false)
{
Some(now_rfc3339())
} else {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep completedAt stable after terminal decommission

completed_at() returns now_rfc3339() every time a pool is polled in a terminal phase (Complete/Canceled/Failed), so the generated status is always different even when nothing changed. Because the controller watches Tenant updates, this can cause a self-triggering reconcile loop (status patch → watch event → reconcile → new timestamp → patch) for canceled/failed requests that do not set a requeue. Persist the first completion time (or reuse the existing status value) instead of regenerating it on every pass.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant