Creates a new write closer that must be released
by the read consumer. This is necessary so that
while commiting the underlying writers in erasure
coding we need to make sure we reply success only if
we have committed to disk.
This in turn also fixes plethora of bugs related to
subsequent PutObject() races with namespace locking.
This patch also enables most of the tests, other than
ListObjects paging which has some issues still.
Fixes#1358, #1360
master
Harshavardhana9 years agocommitted byHarshavardhana
hasher.Write([]byte("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."))
calculatedMD5sum,err=obj.PutObjectPart("bucket","key",uploadID,i,int64(len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")),bytes.NewBufferString("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."),expectedMD5Sumhex)
_,err=obj.PutObject("bucket",key,int64(len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")),bytes.NewBufferString("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."),nil)
_,err=obj.PutObject("bucket",key,int64(len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")),bytes.NewBufferString("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."),nil)
_,err=obj.PutObject("bucket","newPrefix",int64(len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")),bytes.NewBufferString("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."),nil)
_,err=obj.PutObject("bucket","newPrefix2",int64(len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")),bytes.NewBufferString("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."),nil)
_,err=obj.PutObject("bucket","this/is/delimited",int64(len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")),bytes.NewBufferString("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."),nil)
_,err=obj.PutObject("bucket","this/is/also/a/delimited/file",int64(len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")),bytes.NewBufferString("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."),nil)
_,err=obj.PutObject("bucket","object",int64(len("The list of parts was not in ascending order. The parts list must be specified in order by part number.")),bytes.NewBufferString("The list of parts was not in ascending order. The parts list must be specified in order by part number."),nil)
_,err=obj.PutObject("bucket","object",int64(len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")),bytes.NewBufferString("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."),nil)
c.Assert(string(bytesBuffer.Bytes()),check.Equals,"The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")
_,err=obj.PutObject("bucket","dir1/dir2/object",int64(len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")),bytes.NewBufferString("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."),nil)
c.Assert(len(bytesBuffer.Bytes()),check.Equals,len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."))
_,err=obj.PutObject("bucket","dir1/dir3/object",int64(len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")),bytes.NewBufferString("One or more of the specified parts could not be found. The part might not have been uploaded, or the specified entity tag might not have matched the part's entity tag."),nil)
_,err=obj.PutObject("bucket","one",int64(len("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.")),bytes.NewBufferString("The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed."),nil)