From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7928E2A676 for ; Fri, 31 Aug 2018 00:53:57 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RctKe0DFfA-x for ; Fri, 31 Aug 2018 00:53:57 -0400 (EDT) Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [94.100.177.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id ADDA62A5BE for ; Fri, 31 Aug 2018 00:53:56 -0400 (EDT) From: Georgy Kirichenko Subject: [tarantool-patches] Re: [PATCH 1/2] Update lua space cache just after creation Date: Fri, 31 Aug 2018 07:53:49 +0300 Message-ID: <2861224.UIpC4H89V2@home.lan> In-Reply-To: <20180830123106.GB30997@chai> References: <52f6dd8a94f65030216f78796b8ed3d7f91f5eb2.1535472838.git.georgy@tarantool.org> <20180830123106.GB30997@chai> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2289084.Wl11u1yhVT"; micalg="pgp-sha256"; protocol="application/pgp-signature" Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: Konstantin Osipov Cc: tarantool-patches@freelists.org --nextPart2289084.Wl11u1yhVT Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Thursday, August 30, 2018 3:31:07 PM MSK Konstantin Osipov wrote: > We can well use txn->on_commit trigger for this purpose, having > set an on_commit trigger which pushes on_ctl events. This trigger > is invoked *after* a record is written to wal in txn.cc. Why do > you need to manipulate with the internal alter.cc triggers at all? > Why is the order of invocation of these triggers important? No, we can't, because generally there may be a space writes between space was created and space was commited. It is only current implementation issue that index creation acquires a ddl lock and stops applying. > > Ideally, your on_ctl trigger should be invoked after all the alter > triggers ahve been invoked. For that, all you need to do is to > ensure that on_ctl trigger is added *after* the alter trigger - > i.e. it has a lower priority/order than alter trigger. Is your > problem with trigger ordering? Is it that you've been trying to > add alter trigger *after* you added the on_ctl trigger, and, since > triggers are normally added to the end of the list, when on_ctl > trigger was invoked the space was not yet available in box.space? My problem I can't see lua space object for a created space while on_replace fires because on_replace trigger fires at operation stage and lua cache updates only after commit - this is the issue. This can't be solved with trigger ordering cos triggers are running on different stages and the only way i see is to move space cache update trigger to the operation stage. > > If it is the case, then I think we should simply add > trigger_add_first() function, and use this function to add alter > triggers to the beginning of the list. First we should change stage of lua cache updates, that the patch does. > > That would solve the problem until we have more strict ordering > requirements, at which point we could add trigger->order member > and trigger_add_with_order() method. > > Finally, I don't see how the test case is testing the order. I > believe the test case should pass both before and after the patch. Test uses fiber scheduling mechanism, the first fiber creates the second one that creates a space and yields on wal. The first fiber checks that corresponding space objects is visible (the second fiber still waiting for a wal). > > > @@ -1571,3 +1571,64 @@ fio = require('fio') > > > > box.space.test:drop() > > --- > > ... > > > > +-- allocate a space id to prevent max space id update > > Why is test description missing in the result file? > > > Nitpick: please add leading -- and trailing -- to the test > description, start it with a capital letter and end with a dot. > > > Thanks for the patch, --nextPart2289084.Wl11u1yhVT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBJFDbU76LsBbgHBsvKOmCX79zb4FAluIyd0ACgkQvKOmCX79 zb5iWwgAmq+J/uEeV9OwIxXgB54+XsgxZfuVl65AAOKe7P/0nmio61B+WGo2IhP5 tKonc8qj1/vbq3BNjWCgGKjq8QDiJTsk6BrsLBhmXQqHzNHHLuVo+w6zLFxtj7Nt UJySBDO3HY6kbU+LjcvppEcEW3hL58UfaJzdZMvD+7XFODCHVII0GzxUSOrUEENm hfLG3XYxcppSuXRYUBT11wAW3BxUWGMlVE3Q5ADakjCf/4sFXDxaXPmNuTfNgG9B UNeNCuPazYOL1UuPapar49bQv4Do/fuKn2jJ1370b3fpO2QK870sH1Bn7sGwzrY/ 0UVzk61plOE4kCi6SD7xFG8jSTIlpw== =09pC -----END PGP SIGNATURE----- --nextPart2289084.Wl11u1yhVT--