mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 12:10:24 +03:00
xl: Introduce new blocking writer to make CreateFile atomic. (#1362)
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
This commit is contained in:
committed by
Harshavardhana
parent
cab6805f09
commit
57f35c2bcc
@@ -289,10 +289,6 @@ func (o objectAPI) NewMultipartUpload(bucket, object string) (string, *probe.Err
|
||||
// uploadIDPath doesn't exist, so create empty file to reserve the name
|
||||
var w io.WriteCloser
|
||||
if w, e = o.storage.CreateFile(minioMetaVolume, uploadIDPath); e == nil {
|
||||
// Just write some data for erasure code, rather than zero bytes.
|
||||
if _, e = w.Write([]byte(uploadID)); e != nil {
|
||||
return "", probe.NewError(toObjectErr(e, minioMetaVolume, uploadIDPath))
|
||||
}
|
||||
// Close the writer.
|
||||
if e = w.Close(); e != nil {
|
||||
return "", probe.NewError(e)
|
||||
|
||||
Reference in New Issue
Block a user