From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (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 763D04765E0 for ; Thu, 24 Dec 2020 19:11:59 +0300 (MSK) From: Serge Petrenko References: <5d956009946130bbecf19c4f8bd634f1fa53b0bd.1608724239.git.sergepetrenko@tarantool.org> Message-ID: <0e83611c-0652-88a7-d290-f0d4fd9dbc17@tarantool.org> Date: Thu, 24 Dec 2020 19:11:58 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-GB 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: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org 23.12.2020 20:25, Vladislav Shpilevoy пишет: > 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. Thanks for the review & for your suggestion! Sorry I didn't understand your proposal at first. It looks good. I've split your commit and amended this patch and the patch "rework clear_synchro_queue". >> 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; >> } -- Serge Petrenko