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 4BB0827C9A for ; Thu, 20 Jun 2019 04:01:18 -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 gkKjourfF55F for ; Thu, 20 Jun 2019 04:01:18 -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 0917325D0B for ; Thu, 20 Jun 2019 04:01:17 -0400 (EDT) Date: Thu, 20 Jun 2019 11:01:15 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v4 7/9] txn: introduce asynchronous txn commit Message-ID: <20190620080115.GG15155@atlas> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: tarantool-patches@freelists.org Cc: Georgy Kirichenko * Georgy Kirichenko [19/06/20 09:54]: > + txn->fiber = NULL; > + txn->done = false; > /* fiber_on_yield/fiber_on_stop initialized by engine on demand */ > fiber_set_txn(fiber(), txn); > trigger_create(&txn->fiber_on_stop, txn_on_stop, NULL, NULL); > @@ -359,7 +362,11 @@ txn_complete(struct txn *txn) > panic("rollback trigger failed"); > } > fiber_set_txn(fiber(), NULL); > - > + txn->done = true; > + if (txn->fiber == NULL) > + txn_free(txn); > + else if (txn->fiber != fiber()) > + fiber_wakeup(txn->fiber); I think if a journal entry allows multiple triggers, txn->fiber could be moved to a trigger as well, so you don't need to extend the fiber. I like it that you only have a single trigger list - fewer lists to initialize. Unfortunately there are already two lists - commit and rollback - iin the txn -- Konstantin Osipov, Moscow, Russia