mirror of
https://github.com/minio/minio.git
synced 2024-12-25 14:45:54 -05:00
enable --compat flag by default (#9326)
if needed use --no-compat to disable md5sum while verifying any performance numbers. bring back --compat behavior as default to avoid additional documentation and confusing behavior, as we are working towards improving md5sum to be faster on AVX instructions, enabling this should be hardly a problem in future versions of MinIO. fixes #8012 fixes #7859 fixes #7642
This commit is contained in:
parent
bf9d51cf14
commit
7d636a7c13
@ -185,11 +185,5 @@ mc admin update <minio alias, e.g., myminio>
|
|||||||
## Contribute to MinIO Project
|
## Contribute to MinIO Project
|
||||||
Please follow MinIO [Contributor's Guide](https://github.com/minio/minio/blob/master/CONTRIBUTING.md)
|
Please follow MinIO [Contributor's Guide](https://github.com/minio/minio/blob/master/CONTRIBUTING.md)
|
||||||
|
|
||||||
## Caveats
|
|
||||||
MinIO in its default mode doesn't use MD5Sum checkums of incoming streams unless requested by the client in `Content-Md5` header for validation. This may lead to incompatibility with rare S3 clients like `s3ql` which unfortunately do not set `Content-Md5` but depend on hex MD5Sum for the stream to be calculated by the server. MinIO considers this as a bug in `s3ql` and should be fixed on the client side because MD5Sum is a poor way to checksum and validate the authenticity of the objects. Although MinIO provides a workaround until client applications are fixed use `--compat` option instead to start the server.
|
|
||||||
```sh
|
|
||||||
./minio --compat server /data
|
|
||||||
```
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fminio%2Fminio.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fminio%2Fminio?ref=badge_large)
|
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fminio%2Fminio.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fminio%2Fminio?ref=badge_large)
|
||||||
|
@ -149,6 +149,12 @@ func handleCommonCmdArgs(ctx *cli.Context) {
|
|||||||
globalCLIContext.Addr = ctx.String("address")
|
globalCLIContext.Addr = ctx.String("address")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check "no-compat" flag from command line argument.
|
||||||
|
globalCLIContext.StrictS3Compat = true
|
||||||
|
if ctx.IsSet("no-compat") || ctx.GlobalIsSet("no-compat") {
|
||||||
|
globalCLIContext.StrictS3Compat = false
|
||||||
|
}
|
||||||
|
|
||||||
// Set all config, certs and CAs directories.
|
// Set all config, certs and CAs directories.
|
||||||
var configSet, certsSet bool
|
var configSet, certsSet bool
|
||||||
globalConfigDir, configSet = newConfigDirFromCtx(ctx, "config-dir", defaultConfigDir.Get)
|
globalConfigDir, configSet = newConfigDirFromCtx(ctx, "config-dir", defaultConfigDir.Get)
|
||||||
@ -164,9 +170,6 @@ func handleCommonCmdArgs(ctx *cli.Context) {
|
|||||||
globalCertsCADir = &ConfigDir{path: filepath.Join(globalCertsDir.Get(), certsCADir)}
|
globalCertsCADir = &ConfigDir{path: filepath.Join(globalCertsDir.Get(), certsCADir)}
|
||||||
|
|
||||||
logger.FatalIf(mkdirAllIgnorePerm(globalCertsCADir.Get()), "Unable to create certs CA directory at %s", globalCertsCADir.Get())
|
logger.FatalIf(mkdirAllIgnorePerm(globalCertsCADir.Get()), "Unable to create certs CA directory at %s", globalCertsCADir.Get())
|
||||||
|
|
||||||
// Check "compat" flag from command line argument.
|
|
||||||
globalCLIContext.StrictS3Compat = ctx.IsSet("compat") || ctx.GlobalIsSet("compat")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleCommonEnvVars() {
|
func handleCommonEnvVars() {
|
||||||
|
@ -87,8 +87,13 @@ EXAMPLES:
|
|||||||
|
|
||||||
// Handler for 'minio gateway b2' command line.
|
// Handler for 'minio gateway b2' command line.
|
||||||
func b2GatewayMain(ctx *cli.Context) {
|
func b2GatewayMain(ctx *cli.Context) {
|
||||||
|
strictS3Compat := true
|
||||||
|
if ctx.IsSet("no-compat") || ctx.GlobalIsSet("no-compat") {
|
||||||
|
strictS3Compat = false
|
||||||
|
}
|
||||||
|
|
||||||
minio.StartGateway(ctx, &B2{
|
minio.StartGateway(ctx, &B2{
|
||||||
strictS3Compat: ctx.IsSet("compat") || ctx.GlobalIsSet("compat"),
|
strictS3Compat: strictS3Compat,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
20
cmd/main.go
20
cmd/main.go
@ -29,10 +29,12 @@ import (
|
|||||||
|
|
||||||
// GlobalFlags - global flags for minio.
|
// GlobalFlags - global flags for minio.
|
||||||
var GlobalFlags = []cli.Flag{
|
var GlobalFlags = []cli.Flag{
|
||||||
|
// Deprecated flag, so its hidden now - existing deployments will keep working.
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "config-dir, C",
|
Name: "config-dir, C",
|
||||||
Value: defaultConfigDir.Get(),
|
Value: defaultConfigDir.Get(),
|
||||||
Usage: "[DEPRECATED] path to legacy configuration directory",
|
Usage: "[DEPRECATED] path to legacy configuration directory",
|
||||||
|
Hidden: true,
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "certs-dir, S",
|
Name: "certs-dir, S",
|
||||||
@ -51,9 +53,17 @@ var GlobalFlags = []cli.Flag{
|
|||||||
Name: "json",
|
Name: "json",
|
||||||
Usage: "output server logs and startup information in json format",
|
Usage: "output server logs and startup information in json format",
|
||||||
},
|
},
|
||||||
|
// Deprecated flag, so its hidden now, existing deployments will keep working.
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "compat",
|
Name: "compat",
|
||||||
Usage: "enable strict S3 compatibility by turning off certain performance optimizations",
|
Usage: "enable strict S3 compatibility by turning off certain performance optimizations",
|
||||||
|
Hidden: true,
|
||||||
|
},
|
||||||
|
// This flag is hidden and to be used only during certain performance testing.
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "no-compat",
|
||||||
|
Usage: "disable strict S3 compatibility by turning on certain performance optimizations",
|
||||||
|
Hidden: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ func getStorageInfoMsgSafeMode(storageInfo StorageInfo) string {
|
|||||||
var mcMessage string
|
var mcMessage string
|
||||||
if storageInfo.Backend.Type == BackendErasure {
|
if storageInfo.Backend.Type == BackendErasure {
|
||||||
if storageInfo.Backend.OfflineDisks.Sum() > 0 {
|
if storageInfo.Backend.OfflineDisks.Sum() > 0 {
|
||||||
mcMessage = "Use `mc admin info` to look for latest server/disk info`"
|
mcMessage = "Use `mc admin info` to look for latest server/disk info\n"
|
||||||
}
|
}
|
||||||
diskInfo := fmt.Sprintf(" %d Online, %d Offline. ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum())
|
diskInfo := fmt.Sprintf(" %d Online, %d Offline. ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum())
|
||||||
msg += color.Red("Status:") + fmt.Sprintf(getFormatStr(len(diskInfo), 8), diskInfo)
|
msg += color.Red("Status:") + fmt.Sprintf(getFormatStr(len(diskInfo), 8), diskInfo)
|
||||||
@ -269,7 +269,7 @@ func getStorageInfoMsg(storageInfo StorageInfo) string {
|
|||||||
var mcMessage string
|
var mcMessage string
|
||||||
if storageInfo.Backend.Type == BackendErasure {
|
if storageInfo.Backend.Type == BackendErasure {
|
||||||
if storageInfo.Backend.OfflineDisks.Sum() > 0 {
|
if storageInfo.Backend.OfflineDisks.Sum() > 0 {
|
||||||
mcMessage = "Use `mc admin info` to look for latest server/disk info"
|
mcMessage = "Use `mc admin info` to look for latest server/disk info\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
diskInfo := fmt.Sprintf(" %d Online, %d Offline. ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum())
|
diskInfo := fmt.Sprintf(" %d Online, %d Offline. ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum())
|
||||||
|
Loading…
Reference in New Issue
Block a user