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

feat: calculate piece metadata digest #787

Merged
merged 5 commits into from
Nov 10, 2021

Conversation

jim3ma
Copy link
Member

@jim3ma jim3ma commented Nov 9, 2021

Signed-off-by: Jim Ma [email protected]

Description

  1. Calculate pieces metadata digest.
  2. Fix midway back source not work.
  3. Validate finished peer task digest before operate it, eg: get and upload pieces.

Related Issue

Motivation and Context

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist:

  • Code compiles correctly.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@jim3ma jim3ma requested a review from a team as a code owner November 9, 2021 06:50
@codecov-commenter
Copy link

codecov-commenter commented Nov 9, 2021

Codecov Report

Merging #787 (1f87af3) into main (ec8ede0) will increase coverage by 0.63%.
The diff coverage is 30.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #787      +/-   ##
==========================================
+ Coverage   39.58%   40.21%   +0.63%     
==========================================
  Files          94       94              
  Lines        7647     7783     +136     
==========================================
+ Hits         3027     3130     +103     
- Misses       4226     4248      +22     
- Partials      394      405      +11     
Flag Coverage Δ
Object-compatibility-e2etests ?
e2etests ?
unittests 40.21% <30.93%> (+0.63%) ⬆️

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

Impacted Files Coverage Δ
client/daemon/daemon.go 0.00% <0.00%> (ø)
client/daemon/peer/peertask_file.go 52.02% <0.00%> (-1.45%) ⬇️
client/daemon/peer/peertask_manager.go 20.14% <0.00%> (ø)
client/daemon/peer/peertask_stream.go 53.21% <0.00%> (-1.40%) ⬇️
client/daemon/storage/storage_manager.go 20.89% <5.26%> (-0.88%) ⬇️
client/daemon/storage/local_storage.go 24.80% <13.63%> (-4.42%) ⬇️
client/daemon/peer/peertask_file_callback.go 56.19% <28.57%> (-4.25%) ⬇️
client/daemon/peer/peertask_base.go 46.95% <61.11%> (+13.47%) ⬆️
client/daemon/peer/piece_manager.go 69.28% <75.00%> (+1.17%) ⬆️
pkg/util/digestutils/digest_reader.go 76.19% <75.00%> (+1.19%) ⬆️
... and 4 more

@jim3ma jim3ma force-pushed the feat/calculate-piece-metadata-digest branch 2 times, most recently from 4871752 to 49b7b29 Compare November 9, 2021 09:58
@jim3ma jim3ma force-pushed the feat/calculate-piece-metadata-digest branch from 49b7b29 to 00de129 Compare November 9, 2021 11:54
@jim3ma jim3ma force-pushed the feat/calculate-piece-metadata-digest branch 7 times, most recently from 21749ef to b793d40 Compare November 10, 2021 07:16
@jim3ma jim3ma force-pushed the feat/calculate-piece-metadata-digest branch from b793d40 to 1f87af3 Compare November 10, 2021 07:33
Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

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

LGTM

@jim3ma jim3ma merged commit cb4be14 into main Nov 10, 2021
@jim3ma jim3ma deleted the feat/calculate-piece-metadata-digest branch November 10, 2021 11:55
gaius-qi pushed a commit that referenced this pull request Jun 28, 2023
* feat: calculate piece metadata digest
* fix: back source not work in midway
* chore: add partial back source test
* chore: optimize digest log

Signed-off-by: Jim Ma <[email protected]>
e-ngo pushed a commit to e-ngo/dragonfly that referenced this pull request Jan 23, 2025
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.128 to 1.0.132.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](serde-rs/json@1.0.128...1.0.132)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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