From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A5FCA4696C3 for ; Sun, 5 Apr 2020 10:56:25 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id b1so11285567ljp.3 for ; Sun, 05 Apr 2020 00:56:25 -0700 (PDT) Date: Sun, 5 Apr 2020 10:56:22 +0300 From: Cyrill Gorcunov Message-ID: <20200405075622.GC3072@uranus> References: <20200404161524.7466-1-gorcunov@gmail.com> <20200404161524.7466-2-gorcunov@gmail.com> <20200405073140.GA1561@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200405073140.GA1561@atlas> Subject: Re: [Tarantool-patches] [PATCH v11 1/8] box: fix bootstrap comment List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Konstantin Osipov Cc: tml On Sun, Apr 05, 2020 at 10:31:40AM +0300, Konstantin Osipov wrote: > * Cyrill Gorcunov [20/04/05 05:06]: > > We're not starting new master node but > > a new instance instead. The comment simply > > leftover from older modifications. > > I wrote it and it had a meaning. If we call bootstrap, it's > definitely a new master here, because we're creating a new > replicaset uuid. Wait, this looks vague. Here what we have inside /** * Bootstrap a new instance either as the first master in a * replica set or as a replica of an existing master. * * @param[out] is_bootstrap_leader set if this instance is * the leader of a new cluster */ static void bootstrap(const struct tt_uuid *instance_uuid, const struct tt_uuid *replicaset_uuid, bool *is_bootstrap_leader) { ... /* Use the first replica by URI as a bootstrap leader */ struct replica *master = replicaset_leader(); assert(master == NULL || master->applier != NULL); if (master != NULL && !tt_uuid_is_equal(&master->uuid, &INSTANCE_UUID)) { bootstrap_from_master(master); /* Check replica set UUID */ if (!tt_uuid_is_nil(replicaset_uuid) && !tt_uuid_is_equal(replicaset_uuid, &REPLICASET_UUID)) { tnt_raise(ClientError, ER_REPLICASET_UUID_MISMATCH, tt_uuid_str(replicaset_uuid), tt_uuid_str(&REPLICASET_UUID)); } } else { bootstrap_master(replicaset_uuid); *is_bootstrap_leader = true; } ... } Either comment in the function description is wrong, either the comment I modified was wrong. Or maybe I don't understand terminology. Who is master and who is slave node?