[tarantool-patches] Re: [PATCH v4 04/20] refactoring: remove exceptions from replica_check_id
Sergey Ostanevich
sergos at tarantool.org
Mon Oct 21 17:46:54 MSK 2019
LGTM.
On 21 Oct 15:10, Ilya Kosarev wrote:
>
> Hi!
>
> Thanks for your review.
> Yes, it is already done in patch 5 of this patchset named refactoring: clear privilege managing triggers from exceptions.
> Sincerely,
> Ilya Kosarev
>
> >Среда, 16 октября 2019, 17:28 +03:00 от Sergey Ostanevich <sergos at tarantool.org>:
> >
> >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.
> >
>
>
> --
> Ilya Kosarev
More information about the Tarantool-patches
mailing list