fix: capture populate pod logs during migration to handle quick pod cleanup #553
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.75) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #553"
general
weight: 0.35
tshefi
Problem
MTV build
125ee50a81aecafbfd8a805976de2642d6b93ae8deletes populate pods immediately (within milliseconds) when migration succeeds, causingtest_check_xcopy_usedto fail with "No populate pods found" error.MTV build
179b34f5ea6d7e9d4cebe4492df081e84ea8c837keeps populate pods around longer, allowing tests to pass.Evidence
From Jenkins build #36 using MTV build 125ee50:
test_check_xcopy_usedstarts (2 seconds later)Root Cause in MTV
Commit:
a46e47690(MTV-5655) - June 2, 2026This commit changed when populate pods get cleaned up:
Before MTV-5655:
After MTV-5655:
ConditionSucceededis setcleanup(vm, dontFailOnError, true)right after migration successTimeline:
1. Migration completes →
ConditionSucceededset2. MTV immediately calls
cleanup()(commit a46e47690)3.
cleanup()callsDeletePopulatorPods()4. Pods deleted in milliseconds
5. Test tries to check pods → Already gone ❌
Solution
Capture populate pod logs DURING migration execution, before MTV's cleanup can delete them, using a callback pattern that keeps copy-offload logic separate from general migration code.
Changes Made
1. Added callback pattern to
wait_for_migration_complate()inutilities/mtv_migration.py- New optional parameter:
on_status_poll- callback invoked on each poll with current migration status- Keeps general migration code clean - no copy-offload-specific logic
- Allows any feature to hook into the migration status polling loop
2. Created
execute_copyoffload_migration()inutilities/copyoffload_migration.py- Wrapper function for copy-offload migrations
- Creates Migration CR and waits for copy-offload plan secret readiness
- Uses
create_log_capture_callback()to build a status poll callback- Passes callback to
wait_for_migration_complate()for automatic log capture- All copy-offload tests updated to use this wrapper instead of general
execute_migration()3. Created
create_log_capture_callback()inutilities/copyoffload_migration.py- Factory function that creates a callback for
wait_for_migration_complate()- Callback captures populate pod logs when migration status is EXECUTING
- Only captures once per migration to avoid repeated API calls
- Stores logs in
fixture_store["populate_pod_logs"][migration_uid]4. Updated
capture_populate_pod_logs()inutilities/copyoffload_migration.py- Made idempotent - merges new captures with existing cached logs
- Captures from Running, Succeeded, or Failed pods (wherever logs are available)
- Better error handling per-pod with detailed logging
5. Updated
get_populate_pod_logs()inutilities/copyoffload_migration.py- Merges cached logs with live pods (fills cache gaps)
- Returns complete log set from both sources
- Handles case where some pods are cached but others are still live
Why This Works
copyoffload_migration.py, general code stays generalTesting
✅ All pre-commit checks pass (mypy, flake8, ruff, formatting)
✅ Captures logs before MTV's immediate cleanup deletes pods
✅ Backwards compatible with both MTV build behaviors
✅ Jenkins job #56: 20 tests passed (all migrations that executed used our code successfully)
Related Issues
This fix resolves the
test_check_xcopy_usedfailures observed in:Builds using MTV 179b34f (like #34) will continue to work via the fallback to live pod queries.
MTV Upstream Reference
The populate pod cleanup behavior change was introduced in:
a46e47690e32f7c1a7b460a7aa3ddbdbe15dd1dd<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Added a copy-offload execution helper that automatically captures populate-pod logs for XCOPY verification.
Introduced dual-plan and enhanced concurrent plan completion monitoring with per-plan status callbacks.
Bug Fixes
Improved XCOPY used verification by using cached populate-pod logs (with datastore context) to reduce dependency on live pods.
Hardened polling/completion behavior and tightened migration UID resolution; narrowed SSH retryable error handling.
Documentation
Updated copy-offload XCOPY test orchestration guidance and execution modes.
Tests
Updated copy-offload and MTV concurrency/multi-plan tests to use shared fixture storage and plan-aware callbacks/completion helpers.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->