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:
Harshavardhana
2016-04-22 18:16:02 -07:00
committed by Harshavardhana
parent cab6805f09
commit 57f35c2bcc
6 changed files with 162 additions and 61 deletions

View File

@@ -17,8 +17,10 @@
package main
import (
"errors"
"net/http"
"os"
"runtime"
router "github.com/gorilla/mux"
"github.com/minio/minio/pkg/probe"
@@ -42,6 +44,9 @@ func configureServerHandler(srvCmdConfig serverCmdConfig) http.Handler {
fatalIf(probe.NewError(e), "Initializing network fs failed.", nil)
}
} else {
if runtime.GOOS == "windows" {
fatalIf(probe.NewError(errors.New("")), "Initializing XL failed, not supported on windows yet.", nil)
}
// Initialize XL storage API.
storageAPI, e = newXL(srvCmdConfig.exportPaths...)
fatalIf(probe.NewError(e), "Initializing XL failed.", nil)