From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [94.100.177.89]) (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 47BFA4696C3 for ; Thu, 2 Apr 2020 19:05:54 +0300 (MSK) References: <20200402132948.12804-1-arkholga@tarantool.org> <20200402134743.GB30577@atlas> From: Olga Arkhangelskaia Message-ID: <1d29a21b-78bd-d3a8-0210-fb8f9690aea4@tarantool.org> Date: Thu, 2 Apr 2020 19:05:44 +0300 MIME-Version: 1.0 In-Reply-To: <20200402134743.GB30577@atlas> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [Tarantool-patches] [PATCH rfc 0/1] replication: stop resetting existing connections List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Konstantin Osipov , tarantool-patches@dev.tarantool.org, sergepetrenko@tarantool.org, sergos@tarantool.org Hi! Thanks for the reply! Actually main idea was to start  this conversation. 02.04.2020 16:47, Konstantin Osipov пишет: > * Olga Arkhangelskaia [20/04/02 16:30]: > > Could you please explain the idea of the patch? > > As far I can see, you do some strcmp magic to understand if the > uri is the same. Yes. > > Why not use instance uuids? I did not think of uuids in such a way. But  after reading your description it seems good idea (As I understand  even if we have 3301 and localhost:3301 they will have the same uuid). But I am not sure about appliers that should be removed. If there is no UUIDS of existing applier in new appliers pool it should be removed? And we still need to do all this work even if we just changed order in the config. > 0) Introduce uuid -> applier hash. > 1) Create new appliers for all entries in replication. > 2) Establish connections, but do not issue SUBSCRIBE yet. > 3) Look at connection server uuids. If this uuid is already > connected to, then (easy) quietly close the new connection, > and add existing connection to the new instance of uuid hash. > 4) Add the new connection to the new instance of uuid hash. > If there is a duplicate in the *new* instance of the uuid hash, > produce "duplicate connection" error. Otherwise remove/delete all > appliers that are left in the old uuid hash. > > Perhaps we need applier reference counting to make this work > smoothly.nm,mn, > >