From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Georgy Kirichenko Subject: Re: [tarantool-patches] Re: [PATCH 1/2] Update lua space cache just after creation Date: Fri, 31 Aug 2018 07:57:12 +0300 Message-ID: <2482346.ervWByz9rK@home.lan> In-Reply-To: <20180830120657.fhlkoqvowzckashl@esperanza> References: <52f6dd8a94f65030216f78796b8ed3d7f91f5eb2.1535472838.git.georgy@tarantool.org> <20180830120657.fhlkoqvowzckashl@esperanza> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2502289.4kHMCVDPb9"; micalg="pgp-sha256"; protocol="application/pgp-signature" To: tarantool-patches@freelists.org Cc: Vladimir Davydov List-ID: --nextPart2502289.4kHMCVDPb9 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" > > > > + > > + > > +-- 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) --nextPart2502289.4kHMCVDPb9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBJFDbU76LsBbgHBsvKOmCX79zb4FAluIyqgACgkQvKOmCX79 zb71lgf/eCimCMqgZSvWUrSpa05cR82Kgo2cXHO5czeUilGwtbXHsSHI7Di7QhdV nMcsIiQEC53btNniYEkZFbF6Bljlc7i4i8Rue61AUeO+Hz70PL5x5zwVIDghsq/7 REuWVQSELjUVZA85gxt1xBxa/EnF1F6taZyH57/0HUKEZbtqWIPZQnRN5t0pEmp5 I4C+NwitP84hdfBH41rKzBPaHwobdIuJunMM/ck8SFO5ifuy9mtMJVQykrj8/Bsq Bwf3sBFrqVyAXUkUfvsKbhd6BMG1U1xwbvcODQyI6++pzPAsRxVkWZqnU0w7xC19 m/aRFJExnFPBfPxuJjPEUF384tbKNQ== =HSJ9 -----END PGP SIGNATURE----- --nextPart2502289.4kHMCVDPb9--