-
Notifications
You must be signed in to change notification settings - Fork 122
feat(catalog-managed): UCCommitter #1418
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
base: main
Are you sure you want to change the base?
Conversation
e0d9c59 to
2007eaf
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1418 +/- ##
==========================================
- Coverage 84.82% 84.53% -0.29%
==========================================
Files 121 122 +1
Lines 32220 32361 +141
Branches 32220 32361 +141
==========================================
+ Hits 27330 27356 +26
- Misses 3561 3675 +114
- Partials 1329 1330 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kernel/src/table_features/mod.rs
Outdated
| WriterFeature::VacuumProtocolCheck, | ||
| WriterFeature::VariantType, | ||
| WriterFeature::VariantTypePreview, | ||
| WriterFeature::VariantShreddingPreview, | ||
| WriterFeature::V2Checkpoint, |
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.
since the test tables i was playing with have V2Checkpoint and VacuumProtocolCheck I went ahead and listed them here. I think this is safe (and even desirable) since (1) we don't yet write v2 checkpoint and (2) we don't vacuum and this will unblock writes to such tables
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.
Mmm, V2Checkpoint disallows multi-part checkpoints. I guess we don't support that in kernel so we're okay?
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.
you mean for writes? yea and we have no intention of ever writing out multi-part checkpoints since they were broken from the start
| // Note: can't just deserialize to () directly so we make an empty struct to deserialize | ||
| // the `{}` into. Externally we still return unit type for ease of use/understanding. | ||
| #[derive(Deserialize)] | ||
| struct EmptyResponse {} | ||
| let _: EmptyResponse = self.handle_response(response).await?; | ||
| Ok(()) |
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.
fixed latent bug
| let mut table_url = Url::parse(&table_uri)?; | ||
| // add trailing slash | ||
| if !table_url.path().ends_with('/') { | ||
| table_url.path_segments_mut().unwrap().push(""); |
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.
are we trying to push "/" ?
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.
yea it's a little weird.. i think by adding a new empty path segment it adds a trailing slash
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.
can we leave a comment to that effect?
nicklan
left a comment
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.
cool, mostly good just a few comments
kernel/src/table_features/mod.rs
Outdated
| WriterFeature::VacuumProtocolCheck, | ||
| WriterFeature::VariantType, | ||
| WriterFeature::VariantTypePreview, | ||
| WriterFeature::VariantShreddingPreview, | ||
| WriterFeature::V2Checkpoint, |
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.
Mmm, V2Checkpoint disallows multi-part checkpoints. I guess we don't support that in kernel so we're okay?
75a2201 to
aee3668
Compare
aee3668 to
e2c3f6b
Compare
e2c3f6b to
820b8c1
Compare
| ), | ||
| last_backfilled_version, | ||
| ); | ||
| let handle = tokio::runtime::Handle::current(); |
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.
note that this currently only works on tokio - I'll make an issue to do better here.
nicklan
left a comment
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.
looks good, just a few small things
| start_version: Some(0), | ||
| end_version: version.and_then(|v| v.try_into().ok()), | ||
| }; | ||
| // TODO: does it paginate? |
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.
Are we just assuming that the client internally handles any pagination? I think yes?
| if let Some(commits) = &mut commits.commits { | ||
| commits.sort_by_key(|c| c.version); | ||
| } | ||
|
|
||
| // if commits are present, we ensure they are sorted+contiguous | ||
| if let Some(commits) = &commits.commits { |
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.
| if let Some(commits) = &mut commits.commits { | |
| commits.sort_by_key(|c| c.version); | |
| } | |
| // if commits are present, we ensure they are sorted+contiguous | |
| if let Some(commits) = &commits.commits { | |
| // if commits are present, we ensure they are sorted+contiguous | |
| if let Some(commits) = &mut commits.commits { | |
| commits.sort_by_key(|c| c.version); |
That suggestion isn't very readable, just saying we can collapse the two checks
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.
Ohh, maybe that doesn't work because it'll want to borrow as mutable and immutable. Then maybe:
commits.as_mut().map(|commits| commits.sort_by_key(|c| c.version));Fewer lines, maybe not worth it
| let mut table_url = Url::parse(&table_uri)?; | ||
| // add trailing slash | ||
| if !table_url.path().ends_with('/') { | ||
| table_url.path_segments_mut().unwrap().push(""); |
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.
can we leave a comment to that effect?
| }) | ||
| .try_collect()?; | ||
|
|
||
| info!("commits for kernel: {:?}\n", commits); |
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.
debug maybe?
| // `ENDPOINT=".." TABLENAME=".." TOKEN=".." cargo t write_uc_table --nocapture -- --ignored` | ||
| #[ignore] | ||
| #[tokio::test(flavor = "multi_thread")] | ||
| async fn write_uc_table() -> Result<(), Box<dyn std::error::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.
Should this just be an example program? Fine with that being a follow-up
| last_backfilled_version, | ||
| ); | ||
| let handle = tokio::runtime::Handle::current(); | ||
| tokio::task::block_in_place(|| { |
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 only works in the multithreaded runtime. are we sure we'll always have that flavor?
What changes are proposed in this pull request?
Adds a new
UCCommitterfor writing to tables in UC (inuc-catalogcrate for now, final resting place TBD).Additionally, adds the following RW table features in supported writer features (did we never enable
V2Checkpointwrite?)VacuumProtocolCheckV2CheckpointCatalogManaged(behindcatalog-managedfeature flag)CatalogOwnedPreview(behindcatalog-managedfeature flag)How was this change tested?
added an ignored test to write to cc tables; run with
ENDPOINT=".." TABLENAME=".." TOKEN=".." cargo t write_uc_table --nocapture -- --ignored