Skip to content

fix(vm): prevent stuck block-migration jobs after abort#2282

Merged
yaroslavborbat merged 1 commit into
mainfrom
feat/vm/abort-block-jobs
Apr 30, 2026
Merged

fix(vm): prevent stuck block-migration jobs after abort#2282
yaroslavborbat merged 1 commit into
mainfrom
feat/vm/abort-block-jobs

Conversation

@yaroslavborbat
Copy link
Copy Markdown
Member

@yaroslavborbat yaroslavborbat commented Apr 27, 2026

Description

Adds new libvirt patch:

004-fix-migration-cancel-concluded-mirror-jobs.patch

Why do we need it, and what problem does it solve?

Problem: during VIR_MIGRATE_NON_SHARED_INC cancel (AbortJob), QEMU mirror jobs can become concluded while libvirt is still polling synchronous jobs. In this race, final concluded-job handling can be missed: the job is
not dismissed/unregistered, a lingering mirror job remains in QEMU, and the next migration may fail.

What the patch fixes:

  • refreshes monitor job state during cancel polling,
  • converts concluded jobs into pending final states (FAILED/COMPLETED) for libvirt processing,
  • runs normal blockjob finalization (dismiss/unregister),
  • prevents lingering mirror jobs from blocking subsequent migrations.

What is the expected result?

  1. Abort non-shared storage migration multiple times (VIR_MIGRATE_NON_SHARED_INC).
  2. Start migration again after abort.
  3. Expected:
  • no lingering concluded mirror jobs in QEMU,
  • no another migration job is already running due to stale mirror jobs,
  • repeated migrations succeed.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: vm
type: fix
summary: fix stuck block-migration jobs after abort so new migrations can start

@yaroslavborbat yaroslavborbat added this to the v1.9.0 milestone Apr 27, 2026
@yaroslavborbat yaroslavborbat force-pushed the feat/vm/add-domain-jobs-info-subcommands branch from eb7c267 to 20f580d Compare April 27, 2026 14:23
Base automatically changed from feat/vm/add-domain-jobs-info-subcommands to main April 27, 2026 14:35
@yaroslavborbat yaroslavborbat force-pushed the feat/vm/abort-block-jobs branch 2 times, most recently from 0674b1e to 23f0d0d Compare April 29, 2026 12:24
@yaroslavborbat yaroslavborbat changed the title feat(vm): abort block jobs when migration failed fix(vm): prevent stuck block-migration jobs after abort Apr 29, 2026
@yaroslavborbat yaroslavborbat marked this pull request as ready for review April 29, 2026 12:34
@yaroslavborbat yaroslavborbat force-pushed the feat/vm/abort-block-jobs branch from ca8561d to eb309a4 Compare April 29, 2026 12:37
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
@yaroslavborbat yaroslavborbat force-pushed the feat/vm/abort-block-jobs branch from eb309a4 to 321a624 Compare April 29, 2026 12:53
@yaroslavborbat yaroslavborbat merged commit 972578e into main Apr 30, 2026
31 of 32 checks passed
@yaroslavborbat yaroslavborbat deleted the feat/vm/abort-block-jobs branch April 30, 2026 13:27
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.

2 participants