From: Chris Sosnin <k.sosnin@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/2] box: allow schema upgrades within a release
Date: Wed, 25 Mar 2020 22:10:58 +0300 [thread overview]
Message-ID: <676D60B8-AE05-4813-8641-E3B40EC73C7D@tarantool.org> (raw)
In-Reply-To: <6b63f7ed-3ce9-a631-c89a-428b12ac7c75@tarantool.org>
Hi! Thank you for the review!
> On 22 Mar 2020, at 22:43, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
>
> Thanks for the patch!
>
> On 19/03/2020 10:14, Chris Sosnin wrote:
>> To avoid cases when a user has an incorrectly upgraded schema, we
>> introduce new versioning, which can be used to perform upgrades
>> within a single release.
>>
>> Closes #4804
>> Needed for #4666
>> ---
>> src/box/lua/upgrade.lua | 10 +++++++---
>> 1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/box/lua/upgrade.lua b/src/box/lua/upgrade.lua
>> index 075cc236e..92c3b460e 100644
>> --- a/src/box/lua/upgrade.lua
>> +++ b/src/box/lua/upgrade.lua
>> @@ -27,12 +27,14 @@ local mkversion = {}
>> mkversion.__index = mkversion
>> setmetatable(mkversion, {__call = function(c, ...) return c.new(...) end})
>>
>> -function mkversion.new(major, minor, patch)
>> +function mkversion.new(major, minor, patch, build)
>> local self = setmetatable({}, mkversion)
>> self.major = major
>> self.minor = minor
>> self.patch = patch
>> + self.build = build or 0
>> self.id = bit.bor(bit.lshift(bit.bor(bit.lshift(major, 8), minor), 8), patch)
>> + self.id = bit.bor(bit.lshift(self.id, 8), self.build)
>> return self
>> end
>
> Since we don't update mkversion.__tostring(), user during upgrade
> will see his logs as
>
>> set schema version to 2.3.1
>> set schema version to 2.3.1
>> set schema version to 2.3.1
> ... depending on how many schema versions we have within
> release.
>
> Perhaps, it is worth adding the build version to __tostring()
> method. So as not to confuse the user, and simplify debug so
> as user could tell between which builds the upgrade failed.
>
> It does not affect version visibility - box.info.version() is
> reported differently.
Thank you for clarification, I didn’t touch it on purpose and I was wrong.
Fixed.
next prev parent reply other threads:[~2020-03-25 19:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-19 9:14 [Tarantool-patches] [PATCH 0/2] fix assertion fault in SELECT * FROM "_vfunc" Chris Sosnin
2020-03-19 9:14 ` [Tarantool-patches] [PATCH 1/2] box: allow schema upgrades within a release Chris Sosnin
2020-03-22 19:43 ` Vladislav Shpilevoy
2020-03-25 19:10 ` Chris Sosnin [this message]
2020-03-19 9:14 ` [Tarantool-patches] [PATCH 2/2] sql: fix assertion fault in SELECT * FROM "_vfunc" Chris Sosnin
2020-03-22 19:42 ` Vladislav Shpilevoy
2020-03-25 19:18 ` Chris Sosnin
2020-03-27 23:37 ` [Tarantool-patches] [PATCH 0/2] " Vladislav Shpilevoy
2020-04-24 10:14 Chris Sosnin
2020-04-24 10:14 ` [Tarantool-patches] [PATCH 1/2] box: allow schema upgrades within a release Chris Sosnin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=676D60B8-AE05-4813-8641-E3B40EC73C7D@tarantool.org \
--to=k.sosnin@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH 1/2] box: allow schema upgrades within a release' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox