-
Notifications
You must be signed in to change notification settings - Fork 191
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
Add dispersing transistion check #741
Add dispersing transistion check #741
Conversation
s.logger.Error("error getting blob metadata while marking blobDispersing", "err", err) | ||
return err | ||
} | ||
alreadyConfirmed, _ := refreshedMetadata.IsConfirmed() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about just checking if the status is PROCESSING? That's the only valid predecessor for DISPERSING.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
return err | ||
} | ||
alreadyConfirmed, _ := refreshedMetadata.IsConfirmed() | ||
if alreadyConfirmed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part seems not needed anymore
@@ -158,6 +162,23 @@ func (s *SharedBlobStore) MarkBlobConfirmed(ctx context.Context, existingMetadat | |||
} | |||
|
|||
func (s *SharedBlobStore) MarkBlobDispersing(ctx context.Context, metadataKey disperser.BlobKey) error { | |||
refreshedMetadata, err := s.GetBlobMetadata(ctx, metadataKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked the conditional update which may save one RPC call: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html#Expressions.ConditionExpressions.SimpleComparisons
Looks good. Should we add a similar check for the |
Co-authored-by: Bowen Xue <ubuntu@ip-172-31-91-211.ec2.internal>
This PR adds checks in shared_storage.go to ensure, the state of a blob never transit from confirmed to dispersing