refactor(vmsnapshot): remove freeze/unfreeze logic from VMSnapshot controller#2357
Draft
hardcoretime wants to merge 2 commits into
Draft
refactor(vmsnapshot): remove freeze/unfreeze logic from VMSnapshot controller#2357hardcoretime wants to merge 2 commits into
hardcoretime wants to merge 2 commits into
Conversation
…ntroller VMSnapshot controller was incorrectly handling filesystem freeze/unfreeze operations, which is the responsibility of VDSnapshot. This change: - Removes freeze/unfreeze methods from VMSnapshot lifecycle handler - Simplifies Snapshotter interface to only necessary methods - Removes freeze/unfreeze related code from unit tests - Updates mock to match new interface Now VMSnapshot only coordinates VDSnapshot creation, while VDSnapshot is fully responsible for freeze/unfreeze operations. Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
VDSnapshot controller now checks if other VDSnapshots are still in progress before attempting to unfreeze. If other snapshots are active, it will requeue and retry until all snapshots are ready. This fixes a regression where multiple VDSnapshots created by VMSnapshot would race each other - the first one to complete would block the others from unfreezing. Additionally: - Added unit test case for waiting when other VDSnapshots are active - Updated existing test to expect canUnfreeze=true for Ready phase - Added UnfreezeFunc to mock in vdsnapshot tests Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes filesystem freeze/unfreeze logic from VMSnapshot controller. The VMSnapshot controller was incorrectly handling freeze/unfreeze operations, which is the responsibility of VDSnapshot.
Changes made:
freezeVirtualMachine(),unfreezeVirtualMachineIfCan(), andneedToFreeze()methods from VMSnapshot lifecycle handlerWhy do we need it, and what problem does it solve?
The VMSnapshot controller was duplicating freeze/unfreeze logic that already exists in VDSnapshot controller. This caused:
VDSnapshot is the correct place for freeze/unfreeze because:
CanUnfreezeWithVirtualDiskSnapshotWhat is the expected result?
Checklist
Changelog entries