Skip to content

Conversation

@lindig
Copy link
Contributor

@lindig lindig commented Jan 19, 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 lindig requested a review from robhoes January 19, 2026 14:59
(* CA-419840 mark VBD as empty when it is a CDR *)
( Db.VDI.get_VBDs ~__context ~self:vdi |> function
| [] ->
() (* should not happen *)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn’t this be logged as a warning so we can catch it if it happens and inspect the situation? Or we can safely ignore it if it happens so a comment is fine ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In other places we are using fst; I don't expect a VDI not ever having anything but one VBD. But yeah, I could add a warning..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's do that on the original PR, though. This one has problems with the CI, too.

When a CDR is removed from an ISO SR the corresponding VDI is deleted.
This is not obvious in the logs because some logs refer to the VDI by
reference and others by UUID. Tie this together.

Signed-off-by: Christian Lindig <[email protected]>
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]>
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