Skip to content

[release/1.0] content: update copy to discard instead of truncate#2072

Merged
stevvooe merged 2 commits intocontainerd:release/1.0from
dmcgowan:cherry-pick-content-discard
Jan 29, 2018
Merged

[release/1.0] content: update copy to discard instead of truncate#2072
stevvooe merged 2 commits intocontainerd:release/1.0from
dmcgowan:cherry-pick-content-discard

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

Prevents the copy method from calling discard on the writer when the reader is not seekable. Instead, the copy method will discard up to the offset. Truncate is a more expensive operation since any bytes that are truncated already have their hash calculated and are stored on disk in the backend. Re-writing bytes which were truncated requires transferring the data over GRPC again and re-computing the hash up to the point of truncation.

Cherry-pick #2065

Signed-off-by: Derek McGowan <[email protected]>
Prevents the copy method from calling discard on the
writer when the reader is not seekable. Instead,
the copy method will discard up to the offset.
Truncate is a more expensive operation since any
bytes that are truncated already have their hash calculated
and are stored on disk in the backend. Re-writing bytes
which were truncated requires transfering the data over
GRPC again and re-computing the hash up to the point of
truncation.

Signed-off-by: Derek McGowan <[email protected]>
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #2072 into release/1.0 will decrease coverage by 0.01%.
The diff coverage is 44.44%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release/1.0    #2072      +/-   ##
===============================================
- Coverage        50.59%   50.57%   -0.02%     
===============================================
  Files               81       81              
  Lines             7165     7167       +2     
===============================================
  Hits              3625     3625              
- Misses            2847     2848       +1     
- Partials           693      694       +1
Flag Coverage Δ
#linux 50.57% <44.44%> (-0.02%) ⬇️
Impacted Files Coverage Δ
content/helpers.go 36.66% <44.44%> (-1.27%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e89d82...45e7aa5. Read the comment docs.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

@stevvooe stevvooe added this to the 1.0.2 milestone Jan 29, 2018
@stevvooe
Copy link
Copy Markdown
Member

LGTM

@stevvooe stevvooe merged commit 29a899b into containerd:release/1.0 Jan 29, 2018
@dmcgowan dmcgowan deleted the cherry-pick-content-discard branch September 10, 2019 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants