Check for shards needing conversion. Fixes #5723
parent
16995b6c23
commit
aa845cec7e
|
@ -442,6 +442,11 @@ func (s *Server) Open() error {
|
|||
|
||||
// Open TSDB store.
|
||||
if err := s.TSDBStore.Open(); err != nil {
|
||||
// Provide helpful error if user needs to upgrade shards to
|
||||
// tsm1.
|
||||
if serr, ok := err.(tsdb.ShardError); ok && serr.Err == tsdb.ErrUnknownEngineFormat {
|
||||
return influxdb.ErrUpgradeEngine
|
||||
}
|
||||
return fmt.Errorf("open tsdb store: %s", err)
|
||||
}
|
||||
|
||||
|
|
15
errors.go
15
errors.go
|
@ -12,6 +12,11 @@ var (
|
|||
|
||||
// ErrFieldTypeConflict is returned when a new field already exists with a different type.
|
||||
ErrFieldTypeConflict = errors.New("field type conflict")
|
||||
|
||||
// ErrUpgradeEngine will be returned when it's determined that
|
||||
// the server has encountered shards that are not in the `tsm1`
|
||||
// format.
|
||||
ErrUpgradeEngine = errors.New("\n\n" + upgradeMessage + "\n\n")
|
||||
)
|
||||
|
||||
// ErrDatabaseNotFound indicates that a database operation failed on the
|
||||
|
@ -43,3 +48,13 @@ func IsClientError(err error) bool {
|
|||
|
||||
return false
|
||||
}
|
||||
|
||||
const upgradeMessage = `*******************************************************************
|
||||
UNSUPPORTED SHARD FORMAT DETECTED
|
||||
|
||||
As of version 0.11, only tsm shards are supported. Please use the
|
||||
influx_tsm tool to convert non-tsm shards.
|
||||
|
||||
More information can be found at the documentation site:
|
||||
https://docs.influxdata.com/influxdb/v0.10/administration/upgrading
|
||||
*******************************************************************`
|
||||
|
|
|
@ -51,9 +51,9 @@ type ShardError struct {
|
|||
}
|
||||
|
||||
// NewShardError returns a new ShardError.
|
||||
func NewShardError(id uint64, err error) ShardError {
|
||||
func NewShardError(id uint64, err error) error {
|
||||
if err == nil {
|
||||
err = errors.New("unknown error")
|
||||
return nil
|
||||
}
|
||||
return ShardError{id: id, Err: err}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue