[ 
https://issues.apache.org/jira/browse/JCLOUDS-835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15018968#comment-15018968
 ] 

ASF subversion and git services commented on JCLOUDS-835:
---------------------------------------------------------

Commit f706d9c13a78f360d5e0c94c74251a892ce0e66e in jclouds's branch 
refs/heads/master from [~gaul]
[ https://git-wip-us.apache.org/repos/asf?p=jclouds.git;h=f706d9c ]

JCLOUDS-835: Atomically put filesystem blobs

Write to a temporary file and rename to the desired destination to
better match object store semantics.


> filesystem blobstore does not atomically replace objects
> --------------------------------------------------------
>
>                 Key: JCLOUDS-835
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-835
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-blobstore
>    Affects Versions: 1.8.1
>            Reporter: Andrew Gaul
>              Labels: filesystem
>             Fix For: 2.0.0
>
>
> Object stores have atomic replacement of keys, i.e., a mutating operation 
> like write or overwrite should succeed and expose the new object or fail and 
> retain the old object.  The filesystem blobstore does neither of these and 
> also has issues when handling simultaneous writes.  From 
> {{FilesystemStorageStrategyImpl.putBlob}}:
> {code:java}
> try {
>    outputFile.delete();
>    Files.asByteSink(outputFile).writeFrom(his);
>    ...
> } catch (IOException ex) {
>    if (outputFile != null) {
>       if (!outputFile.delete()) {
>          logger.debug("Could not delete %s", outputFile);
>       }
>    }
>    throw ex;
> }
> {code}
> Instead we should write to a temporary file and rename on top of the target 
> object.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to