Bring semantic versioning to provide for rolling upgrades (#5495)
This PR brings semver capabilities in our RPC layer to ensure that we can upgrade the servers in rolling fashion while keeping I/O in progress. This is only a framework change the functionality remains the same as such and we do not have any special API changes for now. But in future when we bring in API changes we will be able to upgrade servers without a downtime. Additional change in this PR is to not abort when serverVersions mismatch in a distributed cluster, instead wait for the quorum treat the situation as if the server is down. This allows for administrator to properly upgrade all the servers in the cluster. Fixes #5393
This commit is contained in:
committed by
kannappanr
parent
48218272cc
commit
1164fc60f3
@@ -101,13 +101,13 @@ const (
|
||||
var configErrs = []error{
|
||||
errInvalidAccessKeyID,
|
||||
errAuthentication,
|
||||
errServerVersionMismatch,
|
||||
errRPCAPIVersionUnsupported,
|
||||
errServerTimeMismatch,
|
||||
}
|
||||
|
||||
// Quick error to actions converts looking for specific errors
|
||||
// Config errs to actions converts looking for specific config errors
|
||||
// which need to be returned quickly and server should wait instead.
|
||||
func quickErrToActions(errMap map[error]int) InitActions {
|
||||
func configErrsToActions(errMap map[error]int) InitActions {
|
||||
var action InitActions
|
||||
for _, configErr := range configErrs {
|
||||
if errMap[configErr] > 0 {
|
||||
@@ -168,7 +168,7 @@ func prepForInitXL(firstDisk bool, sErrs []error, diskCount int) InitActions {
|
||||
}
|
||||
|
||||
// Validates and converts specific config errors into WaitForConfig.
|
||||
if quickErrToActions(errMap) == WaitForConfig {
|
||||
if configErrsToActions(errMap) == WaitForConfig {
|
||||
return WaitForConfig
|
||||
}
|
||||
|
||||
@@ -311,13 +311,15 @@ func retryFormattingXLDisks(firstDisk bool, endpoints EndpointList, storageDisks
|
||||
)
|
||||
case WaitForConfig:
|
||||
// Print configuration errors.
|
||||
return reduceInitXLErrs(storageDisks, sErrs)
|
||||
log.Printf(
|
||||
"Initializing data volume. Waiting for configuration issues to be fixed (%s). (elapsed %s)\n",
|
||||
reduceInitXLErrs(storageDisks, sErrs), getElapsedTime())
|
||||
case WaitForAll:
|
||||
log.Printf("Initializing data volume for first time. Waiting for other servers to come online (elapsed %s)\n", getElapsedTime())
|
||||
case WaitForFormatting:
|
||||
log.Printf("Initializing data volume for first time. Waiting for first server to come online (elapsed %s)\n", getElapsedTime())
|
||||
}
|
||||
case <-globalServiceDoneCh:
|
||||
case <-globalOSSignalCh:
|
||||
return fmt.Errorf("Initializing data volumes gracefully stopped")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user