mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -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:
@@ -149,6 +149,12 @@ func handleCommonCmdArgs(ctx *cli.Context) {
|
||||
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.
|
||||
var configSet, certsSet bool
|
||||
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)}
|
||||
|
||||
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() {
|
||||
|
||||
@@ -87,8 +87,13 @@ EXAMPLES:
|
||||
|
||||
// Handler for 'minio gateway b2' command line.
|
||||
func b2GatewayMain(ctx *cli.Context) {
|
||||
strictS3Compat := true
|
||||
if ctx.IsSet("no-compat") || ctx.GlobalIsSet("no-compat") {
|
||||
strictS3Compat = false
|
||||
}
|
||||
|
||||
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.
|
||||
var GlobalFlags = []cli.Flag{
|
||||
// Deprecated flag, so its hidden now - existing deployments will keep working.
|
||||
cli.StringFlag{
|
||||
Name: "config-dir, C",
|
||||
Value: defaultConfigDir.Get(),
|
||||
Usage: "[DEPRECATED] path to legacy configuration directory",
|
||||
Name: "config-dir, C",
|
||||
Value: defaultConfigDir.Get(),
|
||||
Usage: "[DEPRECATED] path to legacy configuration directory",
|
||||
Hidden: true,
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "certs-dir, S",
|
||||
@@ -51,9 +53,17 @@ var GlobalFlags = []cli.Flag{
|
||||
Name: "json",
|
||||
Usage: "output server logs and startup information in json format",
|
||||
},
|
||||
// Deprecated flag, so its hidden now, existing deployments will keep working.
|
||||
cli.BoolFlag{
|
||||
Name: "compat",
|
||||
Usage: "enable strict S3 compatibility by turning off certain performance optimizations",
|
||||
Name: "compat",
|
||||
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
|
||||
if storageInfo.Backend.Type == BackendErasure {
|
||||
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())
|
||||
msg += color.Red("Status:") + fmt.Sprintf(getFormatStr(len(diskInfo), 8), diskInfo)
|
||||
@@ -269,7 +269,7 @@ func getStorageInfoMsg(storageInfo StorageInfo) string {
|
||||
var mcMessage string
|
||||
if storageInfo.Backend.Type == BackendErasure {
|
||||
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())
|
||||
|
||||
Reference in New Issue
Block a user