From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A63C94765E0 for ; Wed, 23 Dec 2020 20:25:46 +0300 (MSK) References: <5d956009946130bbecf19c4f8bd634f1fa53b0bd.1608724239.git.sergepetrenko@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Wed, 23 Dec 2020 18:25:44 +0100 MIME-Version: 1.0 In-Reply-To: <5d956009946130bbecf19c4f8bd634f1fa53b0bd.1608724239.git.sergepetrenko@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v2 2/6] relay: introduce on_status_update trigger List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org Thanks for the patch! On 23.12.2020 12:59, Serge Petrenko via Tarantool-patches wrote: > The trigger is fired from tx_status_update(), which is the notification > for tx that relay's vclock is updated. > > The trigger will be used to collect synchronous transactions quorum for > old leader's transactions. I meant the trigger could be global, not in relay. The main point of the proposal was not to touch relays almost anyhow. It would make things even simpler. I tried to implement it on your branch. See comments in the next emails, and 1 comment below, in case my proposal won't work somewhy. > Part of #5435 > --- > src/box/relay.cc | 12 ++++++++++++ > src/box/relay.h | 4 ++++ > 2 files changed, 16 insertions(+) > > diff --git a/src/box/relay.cc b/src/box/relay.cc > index e16ac5a6b..dbad8a680 100644 > --- a/src/box/relay.cc > +++ b/src/box/relay.cc > @@ -201,6 +209,7 @@ relay_new(struct replica *replica) > diag_create(&relay->diag); > stailq_create(&relay->pending_gc); > relay->state = RELAY_OFF; > + rlist_create(&relay->tx.on_status_update); You also need to add trigger_destroy() to relay_stop/relay_delete. > return relay; > }