[tarantool-patches] Re: [PATCH 1/2] schema: add "_vcollation" sysview

Vladimir Davydov vdavydov.dev at gmail.com
Wed Jun 5 20:56:45 MSK 2019


On Wed, Jun 05, 2019 at 08:08:46PM +0300, Roman Khabibov wrote:
> >> +local function upgrade_to_2_1_4()
> >> +    local _collation = box.space._collation
> >> +    local _index = box.space._index
> >> +
> >> +    -- System space format usually is in order "id, owner, name...".
> >> +    -- The fields "name", "owner" are swapped in "_collation" format,
> >> +    -- due to the field "owner" was added after the "_collation" creation.
> >> +    box.space._index:delete{276, 1}
> >> +    log.info("update index name on _collation")
> >> +    box.space._index:insert{_collation.id, 2, 'name', 'tree', {unique = true},
> >> +                            {{1, 'string'}}}
> >> +    log.info("create index owner on _collation")
> >> +    box.space._index:insert{_collation.id, 1, 'owner', 'tree', {unique = false},
> >> +                            {{2, 'unsigned'}}}
> > 
> > I don't understand this part. Why do you need to create 'owner' index?
> > Why do you need to update 'name' index?
> create_sysview() can’t work otherwise.

I fail to see why is that. Could you please elaborate?

> 
> +
> +-- Fit _collation indexes to be suitable forcreate_sysview().
> +local function upgrade_collation_to_2_2_2()
> +    local _collation = box.space._collation
> +    local _index = box.space._index
> 
> > 
> >> +    create_vcollation_space()
> >> +end
> >> +
> >> local function get_version()
> >>     local version = box.space._schema:get{'version'}
> >>     if version == nil then
> >> @@ -768,6 +792,7 @@ local function upgrade(options)
> >>         {version = mkversion(2, 1, 1), func = upgrade_to_2_1_1, auto = true},
> >>         {version = mkversion(2, 1, 2), func = upgrade_to_2_1_2, auto = true},
> >>         {version = mkversion(2, 1, 3), func = upgrade_to_2_1_3, auto = true},
> >> +        {version = mkversion(2, 1, 4), func = upgrade_to_2_1_4, auto = true}
> > 
> > Should be in upgrade_to_2_2_1.
> To 2.2.2 maybe?

No. The last release was 2.2.0 so the next one will be 2.2.1.



More information about the Tarantool-patches mailing list