Skip to content

Conversation

@powerslider
Copy link
Contributor

@powerslider powerslider commented Dec 3, 2025

Why this should be merged

Check #4651

How this works

Restructure the vmsync package to separate concerns and prepare for future dynamic state sync support.

  • Extract finalizer.go - VM state finalization logic (finishSync, commitMarkers) moved to dedicated finalizer struct.
  • Add SyncStrategy interface with Start method for sync execution.
  • Implement staticStrategy for current sequential sync behavior.
  • Simplify client.go to orchestrate sync lifecycle via strategy.

This refactoring enables adding dynamic state sync as a separate strategy implementation without modifying existing static sync logic.

How this was tested

existing UT

Need to be documented in RELEASES.md?

no

resolves #4651

Signed-off-by: Tsvetan Dimitrov (tsvetan.dimitrov@avalabs.org)

Restructure the vmsync package to separate concerns and prepare for
future dynamic state sync support.

- Extract `finalizer.go` - VM state finalization logic (`finishSync`,
  `commitMarkers`) moved to dedicated `finalizer` struct.
- Add `SyncStrategy` interface with `Start` method for sync execution.
- Implement `staticStrategy` for current sequential sync behavior.
- Simplify `client.go` to orchestrate sync lifecycle via strategy.

This refactoring enables adding dynamic state sync as a separate
strategy implementation without modifying existing static sync logic.

resolves #4651

Signed-off-by: Tsvetan Dimitrov (tsvetan.dimitrov@avalabs.org)
@powerslider powerslider self-assigned this Dec 3, 2025
@powerslider powerslider requested a review from a team as a code owner December 3, 2025 20:01
@powerslider powerslider changed the title refactor(vmsync): extract SyncStrategy pattern for static state sync refactor(vmsync): extract SyncStrategy pattern for static state sync Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Transform sync client to execute based on static or dynamic sync strategy

3 participants