Skip to content

Improved handling of consumer checks for volume migration#317

Merged
noctarius merged 2 commits into
mainfrom
fix-volume-migration
Jul 13, 2026
Merged

Improved handling of consumer checks for volume migration#317
noctarius merged 2 commits into
mainfrom
fix-volume-migration

Conversation

@noctarius

@noctarius noctarius commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

If the consumer is in pending, in-creation state, a volume migration is not allowed to start and has to wait for the pod to be running. If the pod is stopped (replica=0) or the pvc is unbound, we can skip the connect+validation step.

This PR improves the detection and ensures the coming-up pod isn't interrupted or corrupted. This is a follow up of #316.

@noctarius noctarius added this to the 26.3 milestone Jul 9, 2026
@noctarius noctarius self-assigned this Jul 9, 2026
Copilot AI review requested due to automatic review settings July 9, 2026 14:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Improves volume migration safety by (1) distinguishing “no consumer” vs “consumer not ready” when deciding whether to run NVMe validation, and (2) making the ContinueMigration step crash-safe by checking the backend migration phase before issuing the continue call (follow-up to #316).

Changes:

  • Add uncached Kubernetes reads (APIReader) and richer consumer-state detection to avoid skipping validation for genuinely active volumes and to wait when a consumer pod is Pending.
  • Introduce performMigration to make ContinueMigration idempotent by checking backend MigrationDTO.Phase before continuing.
  • Expand unit test coverage for skipped validation, waiting behavior, and non-idempotent continue hazards.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
internal/webapi/rebalancing.go Adds migration phase constant and a helper to classify terminal migration statuses.
internal/controller/volumemigration_controller.go Updates consumer detection (uncached reads + new error cases) and adds crash-safe performMigration logic around ContinueMigration.
internal/controller/volumemigration_controller_unit_test.go Adds tests for consumer-state behavior and for safe ContinueMigration retry semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/controller/volumemigration_controller.go
Comment thread internal/controller/volumemigration_controller.go
Comment thread internal/controller/volumemigration_controller.go
@noctarius noctarius force-pushed the fix-volume-migration branch from 2fbd73b to 8e80464 Compare July 10, 2026 13:21
@noctarius noctarius merged commit 0e591f9 into main Jul 13, 2026
5 checks passed
@noctarius noctarius deleted the fix-volume-migration branch July 13, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants