feat(storage): implement appendable upload connector#5956
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the appendable_object_writer module and supporting bidi_write infrastructure to enable bidirectional streaming writes for Google Cloud Storage. Key feedback includes avoiding .expect() on parameter conversions to prevent panics, simplifying complex string-folding logic, removing an unnecessary clone of the request object, and ensuring the background worker fails loudly with an explicit error if the stream closes unexpectedly while flushes are pending.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5956 +/- ##
==========================================
+ Coverage 97.73% 97.75% +0.02%
==========================================
Files 244 247 +3
Lines 61096 61799 +703
==========================================
+ Hits 59710 60412 +702
- Misses 1386 1387 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
joshuatants
left a comment
There was a problem hiding this comment.
We're gone through this extensively offline.
f3e8345 to
4c4b7be
Compare
1713d73 to
9cca986
Compare
coryan
left a comment
There was a problem hiding this comment.
This is still too large. Aim for at most 200 lines of new code, which probably means 400 to 600 lines per PR. 1600 lines is simply too large.
Ok. I am going to split this PR into smaller PRs. I'll update once done. Thank you and sorry about this! |
9cca986 to
e86f327
Compare
I split this PR into three PRs:
Thank you. |
| #[derive(Clone, Debug)] | ||
| #[allow(dead_code)] | ||
| pub enum AppendObjectSpecState { | ||
| Write(Box<WriteObjectSpec>, Option<String>), |
There was a problem hiding this comment.
Why a Box<WriteObjectSpec> ?
There was a problem hiding this comment.
Without Box it fails the clippy::large_enum_variant check.
AppendObjectSpecState can either be Append or Write.
Write contains WriteObjectSpec. WriteObjectSpec is large, contains Option<Object>. And Object is a large struct containing many fields.
In Rust, an enum takes a memory of the largest variant, so if WriteObjectSpec is not boxed, AppendObjectSpecState with Append variant will take up memory that fits WriteObjectSpec which is unnecessarily large.
Should I do this way with Box; or without Box but will need #[allow(clippy::large_enum_variant)] macro?
Thanks!
a947a8c to
366919e
Compare
366919e to
8fcbb33
Compare
coryan
left a comment
There was a problem hiding this comment.
LGTM.
For future reference, avoid PRs with 1,000 lines of code (such as this one). It makes it hard to review them thoroughly. This may contradict what other reviewers want (a full picture of all the changes). Consider a draft PR with the full thing and smaller PRs that are part of the changes.
| Err(status) => { | ||
| let mut guard = spec.lock().expect("never poisoned"); | ||
| Err(guard.handle_redirect(status)) |
There was a problem hiding this comment.
optional: the code coverage says this case is not tested. Seems like an important behavior to test
This PR comes after PR #5932.