feat: write to temp dir first#164
Merged
Merged
Conversation
Contributor
Author
|
This change is part of the following stack: Change managed by git-spice. |
7460489 to
e3c2aa4
Compare
be1f74e to
97b9fa3
Compare
97b9fa3 to
44162ff
Compare
44162ff to
53f1652
Compare
53f1652 to
dddbe03
Compare
dddbe03 to
3e2b658
Compare
sgettys
approved these changes
Jun 2, 2026
sgettys
approved these changes
Jun 3, 2026
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.
Prior to this PR, we were writing all blobs to their final destination. If a pull stopped mid way through, push code would see the blob existing even though it was corrupted.
We now added an extra step to our pull code: temp -> final folder move. This will allow us to make sure any blobs put in the final folder by koci have been SHA + size checked. Any mid progress blobs will be separate, thus operations like push will not see them unless properly verified.
This speeds up our existence check in the final folder by only doing a size check instead of a full hash check like we were doing prior.
Added tests.
Benchmarks below show that this change did not hinder performance.
These tests were ran on a M4 Pro MBP on a wired 2.5gbps connection on a layer 3 switch.
Date: 2026-05-26 13:30
Machine: macOS-26.4.1-arm64-arm-64bit-Mach-O
JVM: openjdk version "21.0.11" 2026-04-21 LTS
Go: go version go1.26.3 darwin/arm64
Iterations: 31
Pull