-
Couldn't load subscription status.
- Fork 118
feat!(catalog-managed): New copy_atomic StorageHandler method #1400
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
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1400 +/- ##
==========================================
- Coverage 84.80% 84.79% -0.01%
==========================================
Files 118 118
Lines 30325 30366 +41
Branches 30325 30366 +41
==========================================
+ Hits 25716 25748 +32
- Misses 3382 3387 +5
- Partials 1227 1231 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
23477de to
cd0a59a
Compare
| // Read source file then write atomically with PutMode::Create | ||
| // This ensures: 1) atomicity 2) fails if destination exists | ||
| self.task_executor.block_on(async move { | ||
| let data = store.get(&src_path).await?.bytes().await?; |
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 there concerns about the size of the data we're loading into memory?
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.
yes but i'm advocating not to optimize here. i'll open a follow up to track this tho
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.
b0671cc to
a24e6b7
Compare
What changes are proposed in this pull request?
Adds a new required method:
copy_atomic(&self, src: &Url, dest: &Url) -> DeltaResult<()>toStorageHandler. This PR also adds support for the default engine via the (dumb) way of GET/PUT. Note that I've elected to pursue the simple/correct thing here and we can attempt to optimize in the future (and can open a follow-up if others agree).This implementation proposes a slight departure from existingEngineAPIs: instead of returning aDeltaResult<()>we returnResult<(), CopyError>with CopyError defined as:old pieces on CopyError omitted
It captures the only things we care about from the
copyAPI perspective: either the destination already exists and we can return a nice error message to the user saying their commit has already been published (considering publishing is the main use case of this API for now) or we just got back some other random error which we don't really care what it is, but rather just something we can surface to the user and fail the overall publish API.I've used this PR as an opportunity to introduce an Engine API more aligned with our pursuit of finer-grainer errors (especially for Engine trait) but happy to split out if we think it's better to just retain existing
DeltaResultpattern.Motivation
This PR will be used for commit publishing - basically copying commits from staged commits to published commits. See #1377 for some context on future usage.
This PR affects the following public APIs
New required method in
StorageHandlertrait:copy_atomicHow was this change tested?
new UT for default engine impl