feat: add aimd throttled object store#6266
Conversation
Code ReviewClean, well-documented PR overall. The AIMD algorithm and token bucket are well-structured. Below are the issues I'd flag before merging. P0:
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
| /// | ||
| /// The `object_store` crate surfaces these as `Error::Generic` with the HTTP | ||
| /// status or cloud-specific message embedded in the source chain. We match | ||
| /// against known patterns from S3, GCS, and Azure. |
There was a problem hiding this comment.
I wonder if we could upstream an improvement for this
There was a problem hiding this comment.
Yeah, I've simplified this logic a bit, which should work as long as there are retries configured on the object store. However, I like the opendal approach, which is roughly the equivalent of adding is_temporary to object_store::Generic. I'll work on an upstream PR.
| if let object_store::Error::Generic { source, .. } = err { | ||
| let msg = source.to_string(); | ||
| // Check for common throttle patterns from cloud stores | ||
| msg.contains("429") |
There was a problem hiding this comment.
the bot had a good comment about these. 429 or 503 could occur in the paths of index files or transaction files, so if those paths are also present in the errors then we could make an incorrect inference here.
I wonder if we could find the specific errors for each cloud provider documented. AWS ones seem to be here: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html.
There was a problem hiding this comment.
Getting to the HTTP response from object store is rather tricky and actually probably impossible due to the fact that most errors are private types hiding behind the Error trait so all you can do is grab the error as a string.
I've simplified the logic for now. We look for the word retries, max_retries which is still potentially in a URI but given the whitespace in there I think we're probably ok (I suspect any whitespace in the URI will be %20 or +) We can worry about a better way after we upstream.
There was a problem hiding this comment.
Is this something we could contribute up to object_store?
|
@claude review this PR |
|
I'll analyze this and get back to you. |
This does not hook the throttle up anywhere yet, that will come in a future PR. Closes lance-format#6237 Closes lance-format#6238

This does not hook the throttle up anywhere yet, that will come in a future PR.
Closes #6237
Closes #6238