From: Konstantin Osipov <kostja@tarantool.org> To: tarantool-patches@freelists.org Subject: [tarantool-patches] Re: [PATCH 6/6] [RAW] swim: introduce failure detection component Date: Fri, 29 Mar 2019 21:59:20 +0300 [thread overview] Message-ID: <20190329185920.GE20712@chai> (raw) In-Reply-To: <a4660a32b19b398aa71d2aec22b7dbd9de9f1f21.1553078631.git.v.shpilevoy@tarantool.org> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/03/20 14:11]: > > > +/** > + * Decode a failure detection message. Schedule acks, process > + * acks. > + */ > +static int > +swim_process_failure_detection(struct swim *swim, const char **pos, > + const char *end, const struct sockaddr_in *src, > + const struct tt_uuid *uuid) > +{ > + const char *prefix = "invalid failure detection message:"; > + struct swim_failure_detection_def def; > + struct swim_member_def mdef; > + if (swim_failure_detection_def_decode(&def, pos, end, prefix) != 0) > + return -1; > + say_verbose("SWIM %d: process failure detection's %s", swim_fd(swim), > + swim_fd_msg_type_strs[def.type]); > + swim_member_def_create(&mdef); > + mdef.addr = *src; > + mdef.incarnation = def.incarnation; > + mdef.uuid = *uuid; > + struct swim_member *member = swim_upsert_member(swim, &mdef); > + if (member == NULL) > + return -1; > + if (def.incarnation < member->incarnation) > + return 0; I think this branch a comment. Why do you not respond to pings from older incarnations? > + if (no_acks_to_gc >= 0) > + swim->no_acks_to_gc = no_acks_to_gc; Why do you actually need a custom no_acks_to_gc? Could you please add a comment for this variable declaration? > +enum { > + /** > + * Value being used to say that unacknowledged pings > + * should not affect a certain decision about member. For > + * example, regardless of number of unacked pings, never > + * drop a member. > + */ > + SWIM_NO_ACKS_IGNORE = INT_MAX, > +}; OK, now I get it. You use it to pin members. I would actually use bool is_pinned for that. It seems you make no_acks_to_gc a variable only to use it for pinning. Let's add a separate varaible for pins. > +/** > + * Send a ping to this address. If an ACK is received, the member > + * will be added. Could you also please explain in the comment why this is useful? E.g. why would I want to add a member only after a successful ping/ack? > + */ > +int > +swim_probe_member(struct swim *swim, const char *uri); > + > + SWIM_FD_MSG_TYPE, The patch is generally OK to push after fixing the minor comments above. I also changed a few comments on the branch. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov
next prev parent reply other threads:[~2019-03-29 18:59 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-03-20 10:49 [tarantool-patches] [PATCH 0/6] SWIM failure detection draft Vladislav Shpilevoy 2019-03-20 10:49 ` [tarantool-patches] [PATCH 1/6] swim: follow-ups for SWIM anti-entropy Vladislav Shpilevoy 2019-03-29 8:27 ` [tarantool-patches] " Konstantin Osipov 2019-03-29 10:19 ` Vladislav Shpilevoy 2019-03-20 10:49 ` [tarantool-patches] [PATCH 2/6] test: introduce breakpoints for swim's event loop Vladislav Shpilevoy 2019-03-29 18:20 ` [tarantool-patches] " Konstantin Osipov 2019-04-02 12:25 ` Vladislav Shpilevoy 2019-04-02 19:16 ` Vladislav Shpilevoy 2019-04-02 20:40 ` Konstantin Osipov 2019-04-02 21:26 ` Vladislav Shpilevoy 2019-03-20 10:49 ` [tarantool-patches] [PATCH 3/6] test: remove swim_unblock_fd event from swim test harness Vladislav Shpilevoy 2019-03-29 18:22 ` [tarantool-patches] " Konstantin Osipov 2019-04-02 21:26 ` Vladislav Shpilevoy 2019-03-20 10:49 ` [tarantool-patches] [PATCH 4/6] swim: expose enum swim_member_status to public API Vladislav Shpilevoy 2019-03-29 18:24 ` [tarantool-patches] " Konstantin Osipov 2019-04-02 12:25 ` Vladislav Shpilevoy 2019-04-02 13:17 ` Konstantin Osipov 2019-04-02 21:26 ` Vladislav Shpilevoy 2019-03-20 10:49 ` [tarantool-patches] [PATCH 5/6] test: differentiate blocked and closed swim fake fds Vladislav Shpilevoy 2019-03-29 18:25 ` [tarantool-patches] " Konstantin Osipov 2019-04-02 21:26 ` Vladislav Shpilevoy 2019-03-20 10:49 ` [tarantool-patches] [PATCH 6/6] [RAW] swim: introduce failure detection component Vladislav Shpilevoy 2019-03-29 18:59 ` Konstantin Osipov [this message] 2019-04-02 12:25 ` [tarantool-patches] " Vladislav Shpilevoy 2019-04-04 10:20 ` Vladislav Shpilevoy 2019-04-04 12:45 ` Konstantin Osipov 2019-04-04 13:57 ` Vladislav Shpilevoy 2019-04-04 16:14 ` Vladimir Davydov 2019-04-04 16:47 ` Vladislav Shpilevoy 2019-03-27 19:28 ` [tarantool-patches] [PATCH 7/6] swim: make swim_upsert_member returning two values Vladislav Shpilevoy 2019-03-28 8:52 ` [tarantool-patches] " Konstantin Osipov 2019-03-28 11:52 ` Vladislav Shpilevoy
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=20190329185920.GE20712@chai \ --to=kostja@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH 6/6] [RAW] swim: introduce failure detection component' \ /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