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

adds stripe_size field to pointerdb proto file #218

Merged
merged 3 commits into from
Aug 14, 2018
Merged

Conversation

navillasa
Copy link
Contributor

@navillasa navillasa commented Aug 10, 2018

Adds erasure_share_size field to the RedundancyScheme message in the pointerdb proto file.
Erasure share size is now added to remote pointers in segments store (see makeRemotePointer function).
Adjusts tests in segmentStore accordingly.


This change is Reviewable

@cla-bot cla-bot bot added the cla-signed label Aug 10, 2018
@coveralls
Copy link

coveralls commented Aug 10, 2018

Pull Request Test Coverage Report for Build 2393

  • 9 of 13 (69.23%) changed or added relevant lines in 1 file are covered.
  • 110 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-4.4%) to 64.577%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/storage/segments/store.go 9 13 69.23%
Files with Coverage Reduction New Missed Lines %
pkg/kademlia/node_id.go 1 88.24%
pkg/overlay/service.go 1 88.24%
storage/redis/client.go 2 65.93%
pkg/miniogw/config.go 5 0.0%
pkg/utils/io.go 11 50.0%
pkg/kademlia/routing.go 15 63.72%
pkg/peertls/peertls.go 36 32.58%
pkg/kademlia/routing_helpers.go 39 74.04%
Totals Coverage Status
Change from base Build 2299: -4.4%
Covered Lines: 3225
Relevant Lines: 4994

💛 - Coveralls

@@ -65,12 +65,13 @@ message Pointer {

bytes inline_segment = 3;
RemoteSegment remote = 4;
int64 size = 5;
int64 segment_size = 5;
int32 stripe_size = 6;
Copy link
Member

Choose a reason for hiding this comment

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

This new field should be part of the RedundancyScheme, not the Pointer.

So there won't be any need to rename the size field to segment_size.

And the new field should not be stripe_size, but erasure_share_size, regardless of what's written in the JIRA ticket. It is the erasure share size that is a parameter of the RS scheme, not the stripe size, although they are related.

Copy link
Member

@kaloyan-raev kaloyan-raev left a comment

Choose a reason for hiding this comment

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

Good. We now store the erasure share size in the pointer.

Now we have to make use of it when getting the segment. The Get() method must not use the RedundancyStrategy from the constructor. That one is only for uploading new segments. The Get() method should create a new ErasureScheme from the data we have in the pointer and pass it to the ECClient.

@@ -192,7 +193,13 @@ func (s *segmentStore) Get(ctx context.Context, path paths.Path) (
return nil, Meta{}, Error.Wrap(err)
}

rr, err = s.ec.Get(ctx, nodes, s.rs, pid, pr.GetSize())
es, err := makeErasureScheme(pr.GetRemote().GetRedundancy().GetMinReq(),
pr.GetRemote().GetRedundancy().GetTotal(), pr.GetRemote().GetRedundancy().GetErasureShareSize())
Copy link
Member

@kaloyan-raev kaloyan-raev Aug 13, 2018

Choose a reason for hiding this comment

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

makeEreasureScheme would be even more helpful if it just take a single param pr.GetRemote().GetRedundancy() It can get the min req, total and erasure share size from it in the function implementation.

func makeErasureScheme(minReq, total, eShareSize int32) (eestream.ErasureScheme, error) {
fc, err := infectious.NewFEC(int(minReq), int(total))
if err != nil {
return nil, err
Copy link
Member

Choose a reason for hiding this comment

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

Should we return a wrapped error here? Error.Wrap(err)

Copy link
Contributor Author

@navillasa navillasa left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @kaloyan-raev)


pkg/storage/segments/store.go, line 197 at r2 (raw file):

Previously, kaloyan-raev (Kaloyan Raev) wrote…

makeEreasureScheme would be even more helpful if it just take a single param pr.GetRemote().GetRedundancy() It can get the min req, total and erasure share size from it in the function implementation.

Done.


pkg/storage/segments/store.go, line 216 at r2 (raw file):

Previously, kaloyan-raev (Kaloyan Raev) wrote…

Should we return a wrapped error here? Error.Wrap(err)

Done.


protos/pointerdb/pointerdb.proto, line 69 at r1 (raw file):

Previously, kaloyan-raev (Kaloyan Raev) wrote…

This new field should be part of the RedundancyScheme, not the Pointer.

So there won't be any need to rename the size field to segment_size.

And the new field should not be stripe_size, but erasure_share_size, regardless of what's written in the JIRA ticket. It is the erasure share size that is a parameter of the RS scheme, not the stripe size, although they are related.

Done.

@navillasa navillasa merged commit 6ab323b into master Aug 14, 2018
@navillasa navillasa deleted the pointer-stripe branch August 14, 2018 15:15
iglesiasbrandon pushed a commit that referenced this pull request Dec 7, 2018
* adds erasure_share_size to RS in pointerdb proto

* adds makeErasureScheme helper method to segments store

* cleans up makeErasureScheme function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants