p2panda / aquadoggo

Node for the p2panda network handling validation, storage, aggregation and replication
GNU Affero General Public License v3.0
69 stars 5 forks source link

Do not panic when blob does not have all pieces yet #563

Closed adzialocha closed 1 year ago

adzialocha commented 1 year ago

This PR fixes a race condition where nodes would sometimes crash when they attempted to materialise a blob where not all pieces are in the database yet (for example during replication). This was solved by:

  1. Not failing critically on this error
  2. Moving the check if all pieces are given right at the beginning of the method

Closes #562

📋 Checklist

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 64.81% and project coverage change: -0.68% :warning:

Comparison is base (966774a) 92.35% compared to head (f773516) 91.67%. Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #563 +/- ## ========================================== - Coverage 92.35% 91.67% -0.68% ========================================== Files 106 106 Lines 17835 17980 +145 ========================================== + Hits 16471 16484 +13 - Misses 1364 1496 +132 ``` | [Files Changed](https://app.codecov.io/gh/p2panda/aquadoggo/pull/563?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda) | Coverage Δ | | |---|---|---| | [aquadoggo/src/db/errors.rs](https://app.codecov.io/gh/p2panda/aquadoggo/pull/563?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda#diff-YXF1YWRvZ2dvL3NyYy9kYi9lcnJvcnMucnM=) | `0.00% <ø> (ø)` | | | [aquadoggo/src/materializer/tasks/blob.rs](https://app.codecov.io/gh/p2panda/aquadoggo/pull/563?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda#diff-YXF1YWRvZ2dvL3NyYy9tYXRlcmlhbGl6ZXIvdGFza3MvYmxvYi5ycw==) | `46.25% <18.18%> (-12.22%)` | :arrow_down: | | [aquadoggo/src/db/stores/blob.rs](https://app.codecov.io/gh/p2panda/aquadoggo/pull/563?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda#diff-YXF1YWRvZ2dvL3NyYy9kYi9zdG9yZXMvYmxvYi5ycw==) | `79.49% <76.74%> (-18.90%)` | :arrow_down: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/p2panda/aquadoggo/pull/563/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.