From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 8BE8A469719 for ; Tue, 8 Sep 2020 01:54:13 +0300 (MSK) References: <89d43ffb6714598c377f0fdcccae61a6ab360409.1599173312.git.v.shpilevoy@tarantool.org> <48e523a3-0507-0702-c39d-c1ef367a235a@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Tue, 8 Sep 2020 00:54:11 +0200 MIME-Version: 1.0 In-Reply-To: <48e523a3-0507-0702-c39d-c1ef367a235a@tarantool.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH v2 01/10] applier: store instance_id in struct applier List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko , tarantool-patches@dev.tarantool.org, gorcunov@gmail.com Hi! Thanks for the review! >> diff --git a/src/box/applier.cc b/src/box/applier.cc >> index c1d07ca54..699b5a683 100644 >> --- a/src/box/applier.cc >> +++ b/src/box/applier.cc >> @@ -67,6 +67,23 @@ applier_set_state(struct applier *applier, enum applier_state state) >>       trigger_run_xc(&applier->on_state, applier); >>   } >>   +static inline void >> +applier_assign_instance_id(struct applier *applier) > Maybe call it `applier_set_id`? This way it's shorter and resembles `replica_set_id`. Indeed, that looks better. ==================== diff --git a/src/box/applier.cc b/src/box/applier.cc index 699b5a683..db17c7338 100644 --- a/src/box/applier.cc +++ b/src/box/applier.cc @@ -68,7 +68,7 @@ applier_set_state(struct applier *applier, enum applier_state state) } static inline void -applier_assign_instance_id(struct applier *applier) +applier_set_id(struct applier *applier) { /* * After final join, the applier already received latest @@ -620,7 +620,7 @@ applier_join(struct applier *applier) say_info("final data received"); applier_set_state(applier, APPLIER_JOINED); - applier_assign_instance_id(applier); + applier_set_id(applier); applier_set_state(applier, APPLIER_READY); } @@ -1225,7 +1225,7 @@ applier_subscribe(struct applier *applier) instance_id != REPLICA_ID_NIL) { say_info("final data received"); applier_set_state(applier, APPLIER_JOINED); - applier_assign_instance_id(applier); + applier_set_id(applier); applier_set_state(applier, APPLIER_READY); applier_set_state(applier, APPLIER_FOLLOW); }