From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 87C9E235F6 for ; Fri, 4 May 2018 02:46:06 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K5b7F-Ka8o9O for ; Fri, 4 May 2018 02:46:06 -0400 (EDT) Received: from smtp62.i.mail.ru (smtp62.i.mail.ru [217.69.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id CA1EA23430 for ; Fri, 4 May 2018 02:46:05 -0400 (EDT) From: Georgy Kirichenko Subject: [tarantool-patches] Re: [replication 1/1] replication: Introduce anonymous replicas Date: Fri, 04 May 2018 09:45:58 +0300 Message-ID: <2933481.OYFXySxWCs@home.lan> In-Reply-To: References: <1728544.W9Itg1czF0@home.lan> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3824105.ygmL3DLE64"; micalg="pgp-sha256"; protocol="application/pgp-signature" Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: Ilya Markov --nextPart3824105.ygmL3DLE64 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" One case still does not working for me, reproduced with: 1. Create a master 2. Attach an anonymous replica 3. Shutdown a replica 4. Restart master 5. Startup a replica -> will fail with ER_UNKNOWN_REPLICA Also it should be fine to remove anonymous replicas when disconnected. For this case replica id assignment should be adjusted to (fill a holes between anonymous replicas ids). But we should do it in a separate patch. On Saturday, April 28, 2018 12:50:52 PM MSK Ilya Markov wrote: > Introduce anonymous replicas - replicas, info about which is not stored > in space _cluster, so their info is not replicated. > > Info about these replicas is stored only in runtime data structure on > the master node. > > Closes #3340 .. > @@ -1250,16 +1262,23 @@ box_on_join(const tt_uuid *instance_uuid) > struct iterator *it = index_create_iterator_xc(index, ITER_ALL, > NULL, 0); > IteratorGuard iter_guard(it); > - struct tuple *tuple; > /** Assign a new replica id. */ > uint32_t replica_id = 1; > - while ((tuple = iterator_next_xc(it)) != NULL) { > - if (tuple_field_u32_xc(tuple, > - BOX_CLUSTER_FIELD_ID) != replica_id) > - break; Previously iteration stopped on replica ids holes (e.g. for replica ids 1, 2, 4 the cycle returns 3 as a new replica id). This case is possible through manually cleaning of a _cluster space. I think old behavior should be preserved. > - replica_id++; > + > + replicaset_foreach(replica) { > + if (replica->id != REPLICA_ID_NIL && anonymous > + == replica->anonymous) > + replica_id++; > + } --nextPart3824105.ygmL3DLE64 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBJFDbU76LsBbgHBsvKOmCX79zb4FAlrsAaYACgkQvKOmCX79 zb73RQgApWpUaDvJS5BdXJSgu5LVuofCZixwhf9/GmiWK4PGj1o2zecoGjt7/yhs Rvxiqzbv89V6AYAYtyNs4oCwjAazMESQGRX+Np3ek0eVJKUdle9FmQQ6mi6K7Bj6 jEirAhD2307wIzhCdLyjrzsA1FYsykccNjsFA5CCpSnWOh0MK1ncM+7+t8hGCdF4 jQMYxAHPYLIX8VIzW2UGzFwFAea2LQZKcWlK0iye2wuJibIrKAKV04nU+gzgFLsF ETItjGdtle9DPVhIpeaeLVK/rv49dZ0CJgH5lyIK8IQoppF36GonFQppmS6T6Ywx +iAINzAGY6g/a00/y9eYglS7EBQ8cQ== =5Gs8 -----END PGP SIGNATURE----- --nextPart3824105.ygmL3DLE64--