[Tarantool-patches] [PATCH vshard 1/2] storage: introduce upgrade strategy
Oleg Babin
olegrok at tarantool.org
Mon Mar 23 09:35:02 MSK 2020
Hi! Thanks for the changes! One nit and LGTM.
On 22/03/2020 22:12, Vladislav Shpilevoy wrote:
> But for 0.1.16.0 the atomicity is possible, I added
> box.begin/commit/rollback.
>
> - for _, handler in ipairs(handlers) do
> + for _, handler in ipairs(schema_upgrade_handlers) do
> local next_version = handler.version
> if schema_compare_versions(next_version, version) > 0 then
> local next_version_str = table.concat(next_version, '.')
> log.info("Upgrade vshard to {%s}", next_version_str)
> - handler.func(username, password)
> + local ok, err = pcall(handler.func, username, password)
> + if not ok then
> + log.info("Couldn't upgrade to {%s}: %s", next_version_str, err)
Seems that you've missed box.rollback here. And I think that it should
be something like "if box.is_in_txn() then box.rollback() end"
I'm not sure but is it possible to drop last xlogs for user and start to
use previous version of schema (and vshard version as well) as
workaround in case of "fatal error"?
More information about the Tarantool-patches
mailing list