Skip to content
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

LocalFileSystem Copy is not Atomic #4758

Closed
chebbyChefNEQ opened this issue Aug 31, 2023 · 2 comments · Fixed by #4759
Closed

LocalFileSystem Copy is not Atomic #4758

chebbyChefNEQ opened this issue Aug 31, 2023 · 2 comments · Fixed by #4759
Assignees
Labels
bug object-store Object Store Interface

Comments

@chebbyChefNEQ
Copy link

chebbyChefNEQ commented Aug 31, 2023

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

In most object stores copy operation is atomic, the file will not appear partially written.

However, on *nix, copy is usually not atomic and partially written file can appear.

Describe the solution you'd like

It would be nice if object_store had a atomic_copy api

Describe alternatives you've considered

I have been doing

store.copy(source, staging_file).await?;
store.rename(staging_file, dest).await?;
@chebbyChefNEQ chebbyChefNEQ added the enhancement Any new improvement worthy of a entry in the changelog label Aug 31, 2023
@tustvold tustvold added bug and removed enhancement Any new improvement worthy of a entry in the changelog labels Aug 31, 2023
@tustvold tustvold changed the title Support atomic copy semantic in object_store LocalFileSystem Copy is not Atomic Aug 31, 2023
@tustvold tustvold self-assigned this Aug 31, 2023
@tustvold
Copy link
Contributor

This is actually a bug, ObjectStore operations should be atomic except for where explicitly stated otherwise (append)

tustvold added a commit to tustvold/arrow-rs that referenced this issue Aug 31, 2023
tustvold added a commit that referenced this issue Sep 2, 2023
…ries (#4758) (#4760) (#4759)

* Make LocalFileSystem::copy atomic (#4758)

* Create sub-directories for copy (#4760)

* Fix HttpStore

* Clippy

* Tweak error propagation

* Add doc
@tustvold tustvold added the object-store Object Store Interface label Sep 18, 2023
@tustvold
Copy link
Contributor

label_issue.py automatically added labels {'object-store'} from #4759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug object-store Object Store Interface
Projects
None yet
2 participants