[tarantool-patches] Re: [replication 1/1] replication: Introduce anonymous replicas

Georgy Kirichenko georgy at tarantool.org
Fri May 4 09:45:58 MSK 2018


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++;
> +	}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20180504/dcf4e310/attachment.sig>


More information about the Tarantool-patches mailing list