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 EEAD524323 for ; Tue, 5 Mar 2019 04:11:37 -0500 (EST) 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 OcQ-tBrw6SQn for ; Tue, 5 Mar 2019 04:11:37 -0500 (EST) Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (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 8C946204EC for ; Tue, 5 Mar 2019 04:11:37 -0500 (EST) Date: Tue, 5 Mar 2019 12:11:35 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 3/3] Transaction support for applier Message-ID: <20190305091135.GY21955@chai> 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/03/03 23:30]: > Applier fetch incoming rows to form a transaction and then apply it. > In case of replication all local changes moved to an journal entry > tail to form a separate transaction (like autonomous transaction) > to be able to replicate changes back so applier assumes that transactions > could not be mixed in a replication stream. > > Closes: #2798 > Needed for: #980 > --- > src/box/applier.cc | 243 ++++++++++++++++++++------ > src/box/txn.c | 21 ++- > src/box/txn.h | 4 + > test/replication/transaction.result | 240 +++++++++++++++++++++++++ > test/replication/transaction.test.lua | 86 +++++++++ > 5 files changed, 534 insertions(+), 60 deletions(-) > create mode 100644 test/replication/transaction.result > create mode 100644 test/replication/transaction.test.lua > > diff --git a/src/box/applier.cc b/src/box/applier.cc > index 3222b041d..dfabbe5ab 100644 > --- a/src/box/applier.cc > +++ b/src/box/applier.cc > @@ -48,6 +48,12 @@ > #include "session.h" > #include "cfg.h" > #include "box.h" > +#include "txn.h" I thought we agreed to use box API, not txn API? > +static int > +applier_apply_tx(struct xrow_header *first_row, struct xrow_header *last_row) > +{ > + int res = 0; > + struct txn *txn = NULL; > + struct xrow_header *row = first_row; > + if (first_row != last_row) > + txn = txn_begin(false); Shouldn't it be box_txn_begin()? -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov