[tarantool-patches] Re: [PATCH 1/2] Update lua space cache just after creation

Georgy Kirichenko georgy at tarantool.org
Fri Aug 31 07:57:12 MSK 2018


> > 
> > +
> > +
> > +-- allocate a space id to prevent max space id update
> 
> Why?
If max space id should be updated then space creates in two commits - the first 
one update max space id and the second one - creates space. And then I can't 
schedule fibers to get execution when space is created but not yet commited.
> 
> > +trig = box.schema.space.create('trig')
> > +trig_id = trig.id
> > +trig:drop()
> > +trig = nil
> > +fiber = require('fiber')
> > +ch = fiber.channel(1)
> > +errinj = box.error.injection
> > +test_run:cmd("setopt delimiter ';'")
> > +-- check space exists just after creation
> > +errinj.set("ERRINJ_WAL_WRITE", true);
> > +_ = fiber.create(function ()
> > +        fiber.create(function ()
> > +            pcall(box.schema.space.create, 'trig', {id = trig_id})
> > +            ch:put(true)
> > +        end)
> > +        trig = box.space.trig
> > +    end);
> > +trig ~= nil;
> > +ch:get();
> > +--and not exists after rollback
> > +box.space.trig;
> > +test_run:cmd("setopt delimiter ''");
> > +
> > +errinj.set("ERRINJ_WAL_WRITE", false)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20180831/8bd2c011/attachment.sig>


More information about the Tarantool-patches mailing list