Bug #3708

if_etag_match and if_not_exist preconditions not honoured during missing block check of upload_object

Added by Dionysis Zindros about 11 years ago. Updated about 11 years ago.

Status:Closed Start date:05/09/2013
Priority:Medium Due date:
Assignee:Stavros Sachtouris % Done:

100%

Category:kamaki Spent time: -
Target version:v0.8

Description

When using client.upload_object, the following HTTP requests to the server normally take place:

  1. A HEAD request at the container-level is issued to obtain block size and other meta-information about the server, as well as a check that the server is up and running. This returns a "204 No Content" response with the appropriate headers.
  2. A PUT request is issued at the object-level to obtain the missing blocks of the object being created. This call normally returns a "409 CONFLICT" response, including the list of missing file blocks, provided there are some missing blocks.
  3. A series of POST requests at the container-level are then used to upload the missing blocks to the server at the container-level which results in "202 ACCEPTED" responses.
  4. Finally, a PUT request is issued at the object-level to assemble the uploaded blocks and to create a file, which yields a "201 CREATED" response.

When using the if_etag_match or the if_not_exist parameter to the client.upload_object method, these preconditions are honoured by the client only in the final PUT request. However, if the blocks needed have already been uploaded at a previous stage (for example, as blocks of a different file, or if the client crashed or disconnected before a previous final PUT request), the preconditions are not checked and no appropriate headers are passed to the server. This can yield to a file being replaced even when an etag doesn't match, or even if a file exists despite the if_not_exist parameter being present. Please modify it so that the first PUT request which is used to check for missing blocks also honours the if_etag_match and if_not_exist precondition parameters.

History

#1 Updated by Stavros Sachtouris about 11 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#2 Updated by Stavros Sachtouris about 11 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF