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

Keep encoded blob result until blob reaches terminal state #750

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions disperser/batcher/batcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ func (b *Batcher) updateConfirmationInfo(
} else {
updateConfirmationInfoErr = fmt.Errorf("HandleSingleBatch: trying to update confirmation info for blob in status other than confirmed or insufficient signatures: %s", status.String())
}
b.EncodingStreamer.RemoveEncodedBlob(metadata)
if updateConfirmationInfoErr != nil {
b.logger.Error("HandleSingleBatch: error updating blob confirmed metadata", "err", updateConfirmationInfoErr)
blobsToRetry = append(blobsToRetry, batchData.blobs[blobIndex])
Expand Down
4 changes: 2 additions & 2 deletions disperser/batcher/batcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ func TestBlobRetry(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, disperser.Dispersing, meta.BlobStatus)
encodedResult, err = components.encodingStreamer.EncodedBlobstore.GetEncodingResult(blobKey, 0)
assert.ErrorContains(t, err, "no such key")
assert.Nil(t, encodedResult)
assert.NoError(t, err)
assert.NotNil(t, encodedResult)

err = components.encodingStreamer.RequestEncoding(ctx, out)
assert.NoError(t, err)
Expand Down
2 changes: 0 additions & 2 deletions disperser/batcher/encoding_streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,6 @@ func (e *EncodingStreamer) transitionBlobToDispersing(ctx context.Context, metad
e.logger.Error("error marking blob as dispersing", "err", err, "blobKey", blobKey.String())
return err
}
// remove encoded blob from storage so we don't disperse it again
e.RemoveEncodedBlob(metadata)
return nil
}

Expand Down
8 changes: 4 additions & 4 deletions disperser/batcher/encoding_streamer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,11 +655,11 @@ func TestGetBatch(t *testing.T) {
assert.Equal(t, disperser.Dispersing, metadata2.BlobStatus)
assert.Nil(t, err)
res, err := encodingStreamer.EncodedBlobstore.GetEncodingResult(metadataKey1, core.QuorumID(0))
assert.Nil(t, res)
assert.ErrorContains(t, err, "GetEncodedBlob: no such key")
assert.NoError(t, err)
assert.NotNil(t, res)
res, err = encodingStreamer.EncodedBlobstore.GetEncodingResult(metadataKey1, core.QuorumID(1))
assert.Nil(t, res)
assert.ErrorContains(t, err, "GetEncodedBlob: no such key")
assert.NoError(t, err)
assert.NotNil(t, res)
res, err = encodingStreamer.EncodedBlobstore.GetEncodingResult(metadataKey2, core.QuorumID(0))
assert.Nil(t, res)
assert.ErrorContains(t, err, "GetEncodedBlob: no such key")
Expand Down
Loading