Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make diff snapshots transactional #4580

Merged

Conversation

JackThomson2
Copy link
Contributor

Store kvm dirty bitmap inside firecrackers internal bitmap so no data is lost incase of an error

Changes

As we load the KVM bitmap store it inside the internal firecracker bitmap. This is done incase of a failure while creating the snapshot, as the data is stored until it's completed successfully.

Reason

Making snapshot transactional

Ticket here: #4545

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this
    PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 94.54545% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 82.14%. Comparing base (8b15271) to head (88e13c4).

Files Patch % Lines
src/vmm/src/vstate/memory.rs 94.54% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4580   +/-   ##
=======================================
  Coverage   82.13%   82.14%           
=======================================
  Files         255      255           
  Lines       31267    31283   +16     
=======================================
+ Hits        25682    25698   +16     
  Misses       5585     5585           
Flag Coverage Δ
4.14-c5n.metal 79.64% <94.54%> (+0.01%) ⬆️
4.14-c7g.metal ?
4.14-m5n.metal 79.62% <94.54%> (+0.01%) ⬆️
4.14-m6a.metal 78.85% <94.54%> (+0.01%) ⬆️
4.14-m6g.metal 76.70% <90.90%> (+0.01%) ⬆️
4.14-m6i.metal 79.63% <94.54%> (+0.01%) ⬆️
4.14-m7g.metal 76.70% <90.90%> (+0.01%) ⬆️
5.10-c5n.metal 82.16% <94.54%> (+<0.01%) ⬆️
5.10-c7g.metal ?
5.10-m5n.metal 82.15% <94.54%> (+<0.01%) ⬆️
5.10-m6a.metal 81.45% <94.54%> (+0.01%) ⬆️
5.10-m6g.metal 79.47% <90.90%> (+0.01%) ⬆️
5.10-m6i.metal 82.14% <94.54%> (+<0.01%) ⬆️
5.10-m7g.metal 79.47% <90.90%> (+0.01%) ⬆️
6.1-c5n.metal 82.15% <94.54%> (+<0.01%) ⬆️
6.1-c7g.metal ?
6.1-m5n.metal 82.14% <94.54%> (+<0.01%) ⬆️
6.1-m6a.metal 81.45% <94.54%> (+0.01%) ⬆️
6.1-m6g.metal 79.46% <90.90%> (+<0.01%) ⬆️
6.1-m6i.metal 82.14% <94.54%> (+<0.01%) ⬆️
6.1-m7g.metal 79.46% <90.90%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JackThomson2 JackThomson2 force-pushed the feat/diff_snapshot_transaction branch from 5bf4f93 to cd0eb6b Compare April 27, 2024 13:58
@JackThomson2 JackThomson2 force-pushed the feat/diff_snapshot_transaction branch 2 times, most recently from f489f87 to c49fc4e Compare May 2, 2024 10:23
Store kvm dirty bitmap inside firecrackers internal bitmap so no data is
lost incase of an error

Signed-off-by: Jack Thomson <jackabt@amazon.com>
Co-authored-by: Roman Kovtyukh <HelloDearGrandma@gmail.com>
Co-authored-by: Pablo Barbáchano <pablob@amazon.com>
@roypat roypat force-pushed the feat/diff_snapshot_transaction branch from 0ddeac8 to f497630 Compare May 7, 2024 13:38
Copy link
Contributor

@roypat roypat left a comment

Choose a reason for hiding this comment

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

Looks good! I think everything could be squashed into a single commit (at least the formatting changes from f497630 should go into 5c50b59), but other than that I think we can merge this :)

@roypat roypat requested a review from pb8o May 7, 2024 13:45
Copy link
Contributor

@pb8o pb8o left a comment

Choose a reason for hiding this comment

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

Yep, looks good to me. As Patrick said maybe squash the last two commits and maybe consider using psutil instead of df, but other than that looks good to me.

@JackThomson2 JackThomson2 force-pushed the feat/diff_snapshot_transaction branch from f497630 to 963448b Compare May 9, 2024 16:08
Only if the snapshot writing fails then store the kvm buffer inside the
firecracker internal bitmap. Also attempted to make the filling
algorithm in the test to be dynamic so it will work on ARM
chips

Signed-off-by: Jack Thomson <jackabt@amazon.com>
@JackThomson2 JackThomson2 force-pushed the feat/diff_snapshot_transaction branch from 963448b to 76b7bc5 Compare May 9, 2024 16:21
@pb8o pb8o self-assigned this May 13, 2024
@pb8o pb8o added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label May 13, 2024
@pb8o pb8o merged commit d9599f5 into firecracker-microvm:main May 14, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting review Indicates that a pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants