Skip to content

Conversation

@zachschuermann
Copy link
Member

@zachschuermann zachschuermann commented Oct 22, 2025

What changes are proposed in this pull request?

Adds a new UCCommitter for writing to tables in UC (in uc-catalog crate for now, final resting place TBD).

Additionally, adds the following RW table features in supported writer features (did we never enable V2Checkpoint write?)

  • VacuumProtocolCheck
  • V2Checkpoint
  • CatalogManaged (behind catalog-managed feature flag)
  • CatalogOwnedPreview (behind catalog-managed feature 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

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 29.14286% with 124 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.53%. Comparing base (ddeef7f) to head (820b8c1).

Files with missing lines Patch % Lines
uc-catalog/src/lib.rs 0.00% 57 Missing ⚠️
uc-catalog/src/committer.rs 0.00% 53 Missing ⚠️
kernel/src/path.rs 44.44% 5 Missing and 5 partials ⚠️
kernel/src/committer.rs 87.50% 3 Missing ⚠️
kernel/src/log_path.rs 90.90% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added the breaking-change Change that require a major version bump label Oct 22, 2025
Comment on lines 244 to 248
WriterFeature::VacuumProtocolCheck,
WriterFeature::VariantType,
WriterFeature::VariantTypePreview,
WriterFeature::VariantShreddingPreview,
WriterFeature::V2Checkpoint,
Copy link
Member Author

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

Copy link
Collaborator

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?

Copy link
Member Author

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

Comment on lines +84 to +90
// 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(())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed latent bug

@nicklan nicklan requested review from DrakeLin and nicklan October 23, 2025 18:44
let mut table_url = Url::parse(&table_uri)?;
// add trailing slash
if !table_url.path().ends_with('/') {
table_url.path_segments_mut().unwrap().push("");
Copy link
Collaborator

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 "/" ?

Copy link
Member Author

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

Copy link
Collaborator

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?

Copy link
Collaborator

@nicklan nicklan left a 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

Comment on lines 244 to 248
WriterFeature::VacuumProtocolCheck,
WriterFeature::VariantType,
WriterFeature::VariantTypePreview,
WriterFeature::VariantShreddingPreview,
WriterFeature::V2Checkpoint,
Copy link
Collaborator

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?

@zachschuermann zachschuermann force-pushed the uc-committer branch 5 times, most recently from 75a2201 to aee3668 Compare November 14, 2025 17:03
@zachschuermann zachschuermann removed the breaking-change Change that require a major version bump label Nov 14, 2025
@github-actions github-actions bot added the breaking-change Change that require a major version bump label Nov 14, 2025
),
last_backfilled_version,
);
let handle = tokio::runtime::Handle::current();
Copy link
Member Author

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.

Copy link
Collaborator

@nicklan nicklan left a 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?
Copy link
Collaborator

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?

Comment on lines +70 to 75
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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Collaborator

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("");
Copy link
Collaborator

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);
Copy link
Collaborator

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>> {
Copy link
Collaborator

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(|| {
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Change that require a major version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants