From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 1E34B2B818 for ; Fri, 29 Mar 2019 14:59:23 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6-JXD3EM7cqp for ; Fri, 29 Mar 2019 14:59:23 -0400 (EDT) Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id CC3622B816 for ; Fri, 29 Mar 2019 14:59:22 -0400 (EDT) Received: from [185.6.245.178] (port=52744 helo=atlas.local) by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1h9wim-00028c-TF for tarantool-patches@freelists.org; Fri, 29 Mar 2019 21:59:20 +0300 Date: Fri, 29 Mar 2019 21:59:20 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 6/6] [RAW] swim: introduce failure detection component Message-ID: <20190329185920.GE20712@chai> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org * Vladislav Shpilevoy [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