Skip to content

Comments

MTV-4150 | Fix disk transfer completed when importer pod is pending#4286

Open
gwencasey96 wants to merge 2 commits intokubev2v:mainfrom
gwencasey96:disk-transfer-completed-importer-pod-pendingr
Open

MTV-4150 | Fix disk transfer completed when importer pod is pending#4286
gwencasey96 wants to merge 2 commits intokubev2v:mainfrom
gwencasey96:disk-transfer-completed-importer-pod-pendingr

Conversation

@gwencasey96
Copy link
Contributor

Resolves: MTV-4150

The Disk Transfer step was being marked as completed when a DataVolume reached Succeeded phase, even if the PVCs were not bound or the importer pod was still pending. This could happen when CSI drivers fail to provision volumes (e.g., nfs.csi.k8s.io issues).

This fix adds validation before marking a DataVolume as completed:

  • Verifies the main PVC is bound
  • Verifies the prime PVC (if it exists) is bound
  • Verifies the importer pod (if it exists) is not pending

If any of these checks fail, the task is marked as pending instead of completed, preventing Disk Transfer from showing as completed prematurely.

Also adds a default case to handle unknown/empty DataVolume phases.

@gwencasey96 gwencasey96 force-pushed the disk-transfer-completed-importer-pod-pendingr branch 2 times, most recently from 1ca8695 to 61122cb Compare January 12, 2026 15:53
Resolves: MTV-4150

The Disk Transfer step was being marked as completed when a DataVolume
reached Succeeded phase, even if the PVCs were not bound or the importer
pod was still pending. This could happen when CSI drivers fail to
provision volumes (e.g., nfs.csi.k8s.io issues).

This fix adds validation before marking a DataVolume as completed:
- Verifies the main PVC is bound
- Verifies the prime PVC (if it exists) is bound
- Verifies the importer pod (if it exists) is not pending

If any of these checks fail, the task is marked as pending instead of
completed, preventing Disk Transfer from showing as completed prematurely.

Also adds a default case to handle unknown/empty DataVolume phases.

Signed-off-by: Gwen Casey <gcasey@redhat.com>
@gwencasey96 gwencasey96 force-pushed the disk-transfer-completed-importer-pod-pendingr branch from 61122cb to e4c04d7 Compare January 12, 2026 15:55
@gwencasey96 gwencasey96 changed the title Fix disk transfer completed when importer pod is pending MTV-4150 | Fix disk transfer completed when importer pod is pending Jan 12, 2026
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 92 lines in your changes missing coverage. Please review.
✅ Project coverage is 8.30%. Comparing base (f1fe5d0) to head (e4c04d7).
⚠️ Report is 1533 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/plan/migration.go 0.00% 92 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff            @@
##             main   #4286      +/-   ##
=========================================
- Coverage   15.45%   8.30%   -7.15%     
=========================================
  Files         112     461     +349     
  Lines       23377   52273   +28896     
=========================================
+ Hits         3613    4342     +729     
- Misses      19479   47547   +28068     
- Partials      285     384      +99     
Flag Coverage Δ
unittests 8.30% <0.00%> (-7.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@mnecas mnecas left a comment

Choose a reason for hiding this comment

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

This is hard to read, please change the logic so there are not that many nested conditions. ref

Please take a look at CDI, maybe it does not update the DataVolume status correctly.

@mrnold
Copy link
Contributor

mrnold commented Jan 14, 2026

Where does the DataVolume get set to Succeeded? From the bug, it looks like the phase is just blank:

# oc get dv
NAME                              PHASE   PROGRESS   RESTARTS   AGE
warm-win2019-test-vm-1056-x2zzw           N/A                   23m

The patch is kind of hard to read, but I am more wondering if it fixes the wrong symptom. If you have a controller log or something that shows the DataVolume itself is Succeeded can you attach it to the Jira ticket?

Resolves: MTV-4150

Refactored deeply nested validation code into a helper function
(verifyDataVolumeCompletion) to improve readability and maintainability.

Added comprehensive diagnostic logging to help diagnose CDI behavior:
- Logs DataVolume phase, PVC phase, and pod phase annotation
- Logs when validation fails with detailed state information
- Helps identify if CDI incorrectly sets DataVolume phase to Succeeded

The validation now verifies that:
- Main PVC is bound
- Prime PVC (if exists) is bound
- Importer pod (if exists) is not pending

This prevents marking disk transfer as completed when CDI incorrectly
reports Succeeded phase (e.g., when importer pod is still waiting for
PVC provisioning due to CSI driver issues).

Signed-off-by: Gwen Casey <gcasey@redhat.com>
@sonarqubecloud
Copy link

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.

4 participants