From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id E886C6EC55; Tue, 27 Jul 2021 15:13:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E886C6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627387991; bh=Y/YcJSXhyjUoIkyn29eVFKyt2Vh/yCn6hfiC5p+C14M=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=kbGcHcKGQl7zU0S0Yh7u9JtbdljljOEwoqTgf3TtVgP7zhA3+zGeaWoC/goqhWxLt m5FQLLGcm3hbH5z+htf6MJgQ6JpiEYXB6vhtTOGivqkY1+Nv9A1euok6xMEwMxBvwl vz7uii5DOwcLbf565ozL9njYtBEDbRsT8S/SmxFA= Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id CAF596EC55 for ; Tue, 27 Jul 2021 15:13:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CAF596EC55 Received: by mail-lf1-f54.google.com with SMTP id h2so21317338lfu.4 for ; Tue, 27 Jul 2021 05:13:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SW9d4cZGTt3tdKs6z1G2cT85jIAD8pRNF+2UinOCD5E=; b=XwkUxu/QnpOSzT3TI1Fcc7P60UF+HY0NiRHFbyzcMF+MB5LnU4yIvxsz5B569AclAw IqaaEh1jewhCfNcLQcW/xTz2toxV5JyLmciYyTHXoWb6KegHP4cAetv2YuhEe8D4Qz/0 3VwHQEA2Cpqvftv7s5hv+51hzHlE8cONmThoUA9R5w8EPpUW0aI49VPRgyXOHanPQXTC +B8VCpa8aC0AWKloPXcIxNtKVtiOfxU3Bn/dD3AK+t+swk5i+IT7mJnXGL0auJBKD498 amrffU2JNLUxnm0bfONM3g+DDmcwJbBkmUH1zT15KrQkCz6V6lACJQ1k355tiQdMW0Jy DdQw== X-Gm-Message-State: AOAM533XpVeJXa11PMxWm4lW8yVR7WgfFZzG4SVQ5ac1F7FriS4KgDHR xApVLhZin7OTczq4QZ987aI03ccB6/E= X-Google-Smtp-Source: ABdhPJxXq7qquQhB3vludHdDyY1QmRBzOfwXbRAxHYLVzgNwVU/oM99nNHWuSaqhf2+USHBz3j48/w== X-Received: by 2002:a05:6512:3604:: with SMTP id f4mr17455126lfs.187.1627387988712; Tue, 27 Jul 2021 05:13:08 -0700 (PDT) Received: from grain.localdomain ([5.18.255.97]) by smtp.gmail.com with ESMTPSA id k8sm300874ljn.18.2021.07.27.05.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 05:13:06 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id F1C575A001E; Tue, 27 Jul 2021 15:13:05 +0300 (MSK) Date: Tue, 27 Jul 2021 15:13:05 +0300 To: Vladislav Shpilevoy Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.7 (2021-05-04) Subject: Re: [Tarantool-patches] [PATCH 1/1] replication: set replica ID before _cluster commit X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Sun, Jul 25, 2021 at 06:53:02PM +0200, Vladislav Shpilevoy wrote: > Replica registration works via looking for the smallest not > occupied ID in _cluster and inserting it into the space. > > It works not so good when mvcc is enabled. In particular, if more > than 1 replica try to register at the same time, they might get > the same replica_id because don't see changes of each other until > the registration in _cluster is complete. > > This in the end leads to all replicas failing the registration > except one with the 'duplicate key' error (primary index in > _cluster is replica ID). > > The patch makes the replicas occupy their ID before they commit it > into _cluster. And new replica ID search now uses the replica ID > map instead of _cluster iterator. > > This way the registration works like before - like MVCC does not > exist which is fine. > > Part of #5430 I don't see any obvious problems in the patch, so Ack.