From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 7 Mar 2019 13:53:21 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH v2 2/3] Put all new rows to the end of journal request Message-ID: <20190307105321.ru5lpevqnuvg4b6u@esperanza> References: <2134b8fca0963ebd0a8fb818a66cd05e81ef09a6.1551902962.git.georgy@tarantool.org> <20190307103813.GF5263@chai> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190307103813.GF5263@chai> To: Konstantin Osipov Cc: tarantool-patches@freelists.org, Georgy Kirichenko List-ID: On Thu, Mar 07, 2019 at 01:38:13PM +0300, Konstantin Osipov wrote: > * Georgy Kirichenko [19/03/07 11:20]: > > Form a separate transaction with all local changes in case of replication. > > This is important because we should be able to replicate such changes > > (e.g. made within an on_replace triggers) back. In the opposite case > > local changes will be incorporated into originating transaction and > > wold be skipped by originator replica. > > > > Needed for: #2798 > > OK, this patch makes much more sense than the previous one > -perhaps because this has become an isolated change. > > I liked a single pass over the list of transaction rows more, > obviously (sorry Vova). Sorry for what? I never asked for the two-pass implementation. In fact, I asked Georgy to return to the previous approach, too. > > Could you please return to the idea of the previous patch? > > /* > 0 - count of local rows, 1 - count of remote rows > We need two different counters to make sure that local and > remote transaction is > */ > int n_rows[2]; > > txn->n_rows[stmt->replica_id == instance_id] ++; TBO I find it hackish. n_remote_rows / n_rows looks much easier for understanding IMO. > > and then the same loop as in the previous patch?