-
Notifications
You must be signed in to change notification settings - Fork 174
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
[blobstore] Filter out expired blobs from query #692
[blobstore] Filter out expired blobs from query #692
Conversation
This works as long as we don't change the TTL, but this would break if TTL changes - which is defined onchain. |
Why would we change the TTL? Also I don't like anything to do with assuming the metadata store doesn't have expired blobs. Blobs usually aren't deleted immediately when they get expired on DynamoDB for example, it goes through them at some rate. |
Unclear for now, but we may want to extend the TTL in the future. It's an assumption we have to keep in mind, so I'd rather handle it the right way.
I think thats fair. Should we create an index on |
Yeah let's create an index
Yeah I can add it tomorrow. |
Deployed the index, should be unblocked now |
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.
There seems an issue where Dispersing blobs that are expired will remain stuck in Dispersing after this change
@@ -117,10 +124,14 @@ func (s *BlobMetadataStore) GetBlobMetadataByStatus(ctx context.Context, status | |||
// Because this function scans the entire index, it should only be used for status with a limited number of items. | |||
// It should only be used to filter "Processing" status. To support other status, a streaming version should be implemented. | |||
func (s *BlobMetadataStore) GetBlobMetadataByStatusCount(ctx context.Context, status disperser.BlobStatus) (int32, error) { |
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 function name is a bit odd. It should probably be GetBlobCountByStatus
or GetBlobMetadatCountByStatus
.
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.
Yeah updated to GetBlobMetadatCountByStatus
":status": &types.AttributeValueMemberN{ | ||
Value: strconv.Itoa(int(status)), | ||
}, | ||
":requestedAt": &types.AttributeValueMemberN{ |
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.
liveBlobBoundary
or something? More readable than two requestedAt
s
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.
We now have an index on Expiry
. Updated it to filter by expiry field instead
655d703
to
99d3d85
Compare
That's true. Is it a concern? |
f29ba48
to
0622f30
Compare
Not sure if there is unexpected access (and use) of these "zombie" blobs before they get removed, if so that can cause issue |
e6d9a2e
to
4bc1e4b
Compare
4bc1e4b
to
d45c446
Compare
Added a check on |
Sg, thanks |
d45c446
to
3e289ac
Compare
Why are these changes needed?
Updates
GetBlobMetadataByStatusXXX
methods so that it doesn't fetch any expired blobs (determined by filtering onRequestedAt > Now - TTL
).Checks