MM-15064: allow running with future minor db versions (#10636)

* MM-15064: allow running with future minor db versions

This is to support running another community cluster that stays on the most recent stable version while we test upcoming versions.

During the past few releases, we have committed to not making backwards incompatible schema changes across minor versions. This means that a 5.x server can run against any 5.y schema, y >= x. (It will upgrade to x if y < x).

* check errors on incoming versions vs. Must/panic

* fix TestSaveSchemaVersion
Этот коммит содержится в:
Jesse Hallam
2019-04-22 11:30:58 -04:00
коммит произвёл GitHub
родитель 434f343f69
Коммит 7031846243
3 изменённых файлов: 145 добавлений и 44 удалений

Просмотреть файл

@@ -164,7 +164,12 @@ func NewSqlSupplier(settings model.SqlSettings, metrics einterfaces.MetricsInter
os.Exit(EXIT_CREATE_TABLE)
}
UpgradeDatabase(supplier)
err = UpgradeDatabase(supplier, model.CurrentVersion)
if err != nil {
mlog.Critical("Failed to upgrade database", mlog.Err(err))
time.Sleep(time.Second)
os.Exit(EXIT_GENERIC_FAILURE)
}
supplier.oldStores.team.(*SqlTeamStore).CreateIndexesIfNotExists()
supplier.oldStores.channel.(*SqlChannelStore).CreateIndexesIfNotExists()