-
Notifications
You must be signed in to change notification settings - Fork 226
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
fix(swingset): delete unused snapshots #3505
Merged
Merged
Conversation
This file contains 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
warner
reviewed
Jul 22, 2021
warner
reviewed
Jul 22, 2021
warner
reviewed
Jul 22, 2021
813f43c
to
d615b80
Compare
Oh, we should make sure that terminated vats get removed from the users list. |
d5be4a9
to
2b8a348
Compare
warner
reviewed
Jul 27, 2021
warner
reviewed
Jul 27, 2021
warner
reviewed
Jul 27, 2021
warner
reviewed
Jul 27, 2021
warner
reviewed
Jul 27, 2021
warner
reviewed
Jul 27, 2021
warner
reviewed
Jul 27, 2021
e23f6ca
to
d074c9e
Compare
warner
reviewed
Jul 29, 2021
warner
reviewed
Jul 29, 2021
warner
reviewed
Jul 29, 2021
warner
approved these changes
Jul 29, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One additional check in the unit test recommended, rest looks good.
runSteps didn't create it; its caller still has a reference
In addition to maintaining a mapping from vatID to snapshotID, vatKeeper maintains a reverse mapping. After `commitCrank()`, the kernel calls `vatWarehouse.pruneSnapshots()`, which 1. calls `kernelKeeper.getUnusedSnapshots()`, 2. tries to `snapStore.delete()` each of them, and 3. reports the results using `kernelKeeper.forgetUnusedSnapshots()`. fixes #3374
Pruning snapshots involves an O(n) query on the DB, so doing it on every crank seems expensive. refs #3374
- makeSnapStoreIO is in swing-store-lmdb now - vatKeeper.saveSnapshot() prepares deletes - removeFromSnapshot() returns consumers.length - no more vatWarehouse.pruneSnapshots - no more snapshotPruneInterval - test-warehouse: use commit() - test-reload-snapshot: update imports
- getRequired() asserts that get() does not return undefined - fix addHelpers() return type by declaring arg type - where kvStore.get() is ensured by getKeys() or has(), mark the alternative with assert.fail().
to avoid @agoric/xsnap in swing-store-lmdb devDependencies
plus one more /etc/passwd test
c6e76e0
to
1b2050d
Compare
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.
In addition to maintaining a mapping from vatID to snapshotID,
vatKeeper maintains a reverse mapping.
After
commitCrank()
, the kernel callsvatWarehouse.pruneSnapshots()
,which, if
snapshotPruneInterval
cranks have passed:kernelKeeper.getUnusedSnapshots()
,snapStore.delete()
each of them, andkernelKeeper.forgetUnusedSnapshots()
.fixes #3374
includes progress on #3431