[tarantool-patches] Re: [PATCH v4 04/20] refactoring: remove exceptions from replica_check_id

Sergey Ostanevich sergos at tarantool.org
Wed Oct 16 17:28:38 MSK 2019


Hi!



On 23 Sep 18:56, Ilya Kosarev wrote:
> replica_check_id is used in on_replace_dd_cluster trigger
> therefore it has to be cleared from exceptions. Now it doesn't
> throw any more. It's usages are updated.
> 
> Part of #4247
> ---
>  src/box/alter.cc       |  6 ++++--
>  src/box/replication.cc | 21 ++++++++++++++-------
>  src/box/replication.h  |  2 +-
>  3 files changed, 19 insertions(+), 10 deletions(-)
> 
> diff --git a/src/box/alter.cc b/src/box/alter.cc
> index 1fce160f5..d4cb9e8d8 100644
> --- a/src/box/alter.cc
> +++ b/src/box/alter.cc
> @@ -3627,7 +3627,8 @@ on_replace_dd_cluster(struct trigger *trigger, void *event)
>  		/* Check fields */
>  		uint32_t replica_id =
>  			tuple_field_u32_xc(new_tuple, BOX_CLUSTER_FIELD_ID);
> -		replica_check_id(replica_id);
> +		if (replica_check_id(replica_id) != 0)
> +			return -1;
>  		tt_uuid replica_uuid;
>  		tuple_field_uuid_xc(new_tuple, BOX_CLUSTER_FIELD_UUID,
>  				    &replica_uuid);
> @@ -3665,7 +3666,8 @@ on_replace_dd_cluster(struct trigger *trigger, void *event)
>  		assert(old_tuple != NULL);
>  		uint32_t replica_id =
>  			tuple_field_u32_xc(old_tuple, BOX_CLUSTER_FIELD_ID);
> -		replica_check_id(replica_id);
> +		if (replica_check_id(replica_id) != 0)
> +			return -1;
>  
>  		struct trigger *on_commit;
>  		on_commit = txn_alter_trigger_new(unregister_replica,


Every call of txn_alter_trigger_new() in on_replace_dd_cluster() also needs
error handling.

Sergos.




More information about the Tarantool-patches mailing list