RobinLin666 commented on PR #5094:
URL: https://github.com/apache/arrow-rs/pull/5094#issuecomment-1817721569

   Hi @tustvold , thank you very much for your suggestion.
   I think this line **has no impact on the atomicity of the whole function**, 
but it may affect the performance and error handling. 
   ```rust
   std::mem::drop(file);
   ```
   This line releases the ownership of the file variable, but does not delete 
or modify the file itself. The file system is only affected when 
std::fs::rename or std::fs::hard_link are called. These operations are atomic, 
meaning they either succeed or fail without leaving any intermediate state. 
Therefore, the code is safe and does not cause file corruption or partial write.
   
   However, this line may have some impact on the performance and error 
handling. If this line is not added, the file variable will be automatically 
dropped at the end of the function, which may delay some time. If this line is 
added, the file variable will be dropped immediately, which may improve some 
performance. But this also means that the file variable cannot be used for any 
further operations, such as checking for write errors, or closing the file.
   
   BTW, the put method of object_store Azure abstraction also sends an http 
request, which is the same behavior as blobfuse, and blobfuse also sends some 
http requests. However, in this scenario, due to the implementation of 
local.rs, blobfuse will send some more requests, such as rename, etc. But this 
does not affect the atomicity of the whole put behavior. Yes, that’s right, in 
terms of performance, it may indeed be worse than using azure abstraction 
directly, but for some reason, users may indeed want to use mount to operate 
(some of the advantages of mount have been mentioned above) and do not care 
about this point of performance impact. I think we should support this user 
operation. What do you think?
   
   If I say something wrong, please correct me, because I just started to learn 
arrow. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to