Skip to content

Conversation

@lindig
Copy link
Contributor

@lindig lindig commented Jan 16, 2026

When a CDR is removed from an ISO SR the corresponding VDI is deleted. So far we relied on the DB GC to mark the VBD as empty. This creates a window for a race where the VDI/CD is reported as present when in fact it is not. So mark the VBD as empty as early as possible.

@lindig
Copy link
Contributor Author

lindig commented Jan 16, 2026

I will also create a PR for a back port

@lindig lindig force-pushed the private/christianlin/CA-419840 branch from dd22182 to 73bc557 Compare January 19, 2026 15:34
Copy link
Member

@robhoes robhoes left a comment

Choose a reason for hiding this comment

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

Just one minor comment, but otherwise looks good.

(* CA-419840 mark VBD as empty when it is a CDR *)
( Db.VDI.get_VBDs ~__context ~self:vdi |> function
| [] ->
warn "%s: no VBD for VDI %s" __FUNCTION__ (Ref.string_of vdi)
Copy link
Member

Choose a reason for hiding this comment

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

I think warn will sound too alarming here. This is probably a common case and not a problem at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it and rebased.

When a CDR is removed from an ISO SR the corresponding VDI is deleted.
So far we relied on the DB GC to mark the VBD as empty. This creates a
window for a race where the VDI/CD is reported as present when in fact
it is not. So mark the VBD as empty as early as possible.

Signed-off-by: Christian Lindig <[email protected]>
@lindig lindig force-pushed the private/christianlin/CA-419840 branch from 73bc557 to be5420b Compare January 21, 2026 10:17
@lindig lindig added this pull request to the merge queue Jan 21, 2026
Merged via the queue into xapi-project:master with commit 736eeb1 Jan 21, 2026
16 checks passed
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.

3 participants