Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-835

filesystem blobstore does not atomically replace objects

    XMLWordPrintableJSON

Details

    Description

      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:

      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;
      }
      

      Instead we should write to a temporary file and rename on top of the target object.

      Attachments

        Activity

          People

            gaul Andrew Gaul
            gaul Andrew Gaul
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: