From: Georgy Kirichenko <georgy@tarantool.org>
To: Ilya Kosarev <i.kosarev@tarantool.org>
Cc: tarantool-patches@freelists.org, i.kosarev@corp.mail.ru
Subject: [tarantool-patches] Re: [PATCH v2 1/6] refactoring: remove exceptions from triggers except alter.cc
Date: Tue, 27 Aug 2019 11:29:31 +0300 [thread overview]
Message-ID: <2544087.m1KnZoLZEZ@home.lan> (raw)
In-Reply-To: <0bc89d20f2b2e45a1e46ab55d9ab517a1d0410cc.1565979897.git.i.kosarev@tarantool.org>
This patch looks good for me but I would prefer if you didn't change the
formatting here:
> -static void
> +static int
> replica_on_applier_state_f(struct trigger *trigger, void *event)
> {
> (void)event;
> struct replica *replica = container_of(trigger,
> struct replica, on_applier_state);
> switch (replica->applier->state) {
> - case APPLIER_INITIAL_JOIN:
> - replicaset.is_joining = true;
> - break;
> - case APPLIER_JOINED:
> - replicaset.is_joining = false;
> - break;
> - case APPLIER_CONNECTED:
> - if (tt_uuid_is_nil(&replica->uuid))
> - replica_on_applier_connect(replica);
> - else
> - replica_on_applier_reconnect(replica);
> - break;
> - case APPLIER_LOADING:
> - case APPLIER_DISCONNECTED:
> - replica_on_applier_disconnect(replica);
> - break;
> - case APPLIER_FOLLOW:
> - replica_on_applier_sync(replica);
> - break;
> - case APPLIER_OFF:
> - /*
> - * Connection to self, duplicate connection
> - * to the same master, or the applier fiber
> - * has been cancelled. Assume synced.
> - */
> - replica_on_applier_sync(replica);
> - break;
> - case APPLIER_STOPPED:
> - /* Unrecoverable error. */
> - replica_on_applier_disconnect(replica);
> - break;
> - default:
> - break;
> + case APPLIER_INITIAL_JOIN:
> + replicaset.is_joining = true;
> + break;
> + case APPLIER_JOINED:
> + replicaset.is_joining = false;
> + break;
> + case APPLIER_CONNECTED:
> + try {
> + if (tt_uuid_is_nil(&replica->uuid))
> + replica_on_applier_connect(replica);
> + else
> + replica_on_applier_reconnect(replica);
> + } catch (Exception *e) {
> + return -1;
> + }
> + break;
> + case APPLIER_LOADING:
> + case APPLIER_DISCONNECTED:
> + replica_on_applier_disconnect(replica);
> + break;
> + case APPLIER_FOLLOW:
> + replica_on_applier_sync(replica);
> + break;
> + case APPLIER_OFF:
> + /*
> + * Connection to self, duplicate connection
> + * to the same master, or the applier fiber
> + * has been cancelled. Assume synced.
> + */
> + replica_on_applier_sync(replica);
> + break;
> + case APPLIER_STOPPED:
> + /* Unrecoverable error. */
> + replica_on_applier_disconnect(replica);
> + break;
> + default:
> + break;
> }
> fiber_cond_signal(&replicaset.applier.cond);
> + return 0;
> }
>
next prev parent reply other threads:[~2019-08-27 8:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-16 18:37 [tarantool-patches] [PATCH v2 0/6] refactoring: remove exceptions from triggers Ilya Kosarev
2019-08-16 18:37 ` [tarantool-patches] [PATCH v2 1/6] refactoring: remove exceptions from triggers except alter.cc Ilya Kosarev
2019-08-27 8:29 ` Georgy Kirichenko [this message]
2019-08-16 18:37 ` [tarantool-patches] [PATCH v2 2/6] refactoring: remove exceptions from used in alter.cc outer functions Ilya Kosarev
2019-08-27 8:37 ` [tarantool-patches] " Georgy Kirichenko
2019-08-16 18:37 ` [tarantool-patches] [PATCH v2 3/6] refactoring: replace most obvious exceptions in alter.cc Ilya Kosarev
2019-08-27 8:41 ` [tarantool-patches] " Georgy Kirichenko
2019-09-02 11:53 ` [tarantool-patches] Re[2]: [PATCH v2] refactoring: remove exceptions from triggers Ilya Kosarev
2019-08-16 18:37 ` [tarantool-patches] [PATCH v2 4/6] refactoring: replace exceptions in most alter.cc functions Ilya Kosarev
2019-08-16 18:37 ` [tarantool-patches] [PATCH v2 5/6] refactoring: replace some more exceptions in alter.cc Ilya Kosarev
2019-08-16 18:37 ` [tarantool-patches] [PATCH v2 6/6] refactoring: replace remaining exceptions in alter.cc & update comments Ilya Kosarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2544087.m1KnZoLZEZ@home.lan \
--to=georgy@tarantool.org \
--cc=i.kosarev@corp.mail.ru \
--cc=i.kosarev@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH v2 1/6] refactoring: remove exceptions from triggers except alter.cc' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox