From: Konstantin Osipov <kostja@tarantool.org> To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com Subject: Re: [tarantool-patches] [PATCH v3 2/6] [RAW] swim: introduce failure detection component Date: Wed, 9 Jan 2019 16:48:09 +0300 [thread overview] Message-ID: <20190109134809.GE20509@chai> (raw) In-Reply-To: <9b4bdddc30f9554b85c9890c0d6c70645c0c7930.1546077015.git.v.shpilevoy@tarantool.org> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [18/12/29 15:07]: > enum { > /** How often to send membership messages and pings. */ > HEARTBEAT_RATE_DEFAULT = 1, > + /** > + * If a ping was sent, it is considered to be lost after > + * this time without an ack. > + */ > + ACK_TIMEOUT = 1, The timeout should be configurable. A reasonable default looks more close 30 seconds at least - we have many cases in (malfunctioning) production when long requests stall the event loop for 10-15 seconds, such requests should not lead to membership storms. > + /** > + * If a member has not been responding to pings this > + * number of times, it is considered to be dead. > + */ > + NO_ACKS_TO_DEAD = 3, > + /** > + * If a not pinned member confirmed to be dead, it is > + * removed from the membership after at least this number > + * of failed pings. > + */ > + NO_ACKS_TO_GC = NO_ACKS_TO_DEAD + 2, > }; > > + bool is_pinned; > + /** Growing number to refute old messages. */ reject, or perhaps ignore? refute is usually used for arguments in a heated conversation. > + /** > + * How many pings did not receive an ack in a row. After > + * a threshold the instance is marked as dead. After more > + * it is removed from the table (if not pinned). > + */ > + int failed_pings; These are more like unacknowledged pings. Have they failed? Maybe. > + /** When the latest ping was sent to this member. */ > + double ping_ts; last_ping_time? Why use double and not ev_time_t? > + /** Type of the failure detection message: ping or ack. */ > + SWIM_FD_MSG_TYPE, > + /** > + * Incarnation of the sender. To make the member alive if > + * it was considered to be dead, but ping/ack with greater > + * incarnation was received from it. > + */ > + SWIM_FD_INCARNATION, Uhm, FD is too commonly used for a file descriptor. Please use a different name. Why not simply SWIM_PING and SWIM_ACK? > struct swim_transport swim_udp_transport = { > /* .send_round_msg = */ swim_udp_send_msg, > + /* .send_ping = */ swim_udp_send_msg, > + /* .send_ack = */ swim_udp_send_msg, Why do you need a separate transport api for ack/ping sends? Shouldn't send/recv be enough? This is a transport layer, it should be unaware of protocol details. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov
next prev parent reply other threads:[~2019-01-09 13:48 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-12-29 10:14 [PATCH v3 0/6] SWIM draft Vladislav Shpilevoy 2018-12-29 10:14 ` [PATCH v3 1/6] [RAW] swim: introduce SWIM's anti-entropy component Vladislav Shpilevoy 2019-01-09 9:12 ` [tarantool-patches] " Konstantin Osipov 2019-01-15 14:42 ` [tarantool-patches] " Vladislav Shpilevoy 2019-01-09 11:45 ` [tarantool-patches] " Konstantin Osipov 2019-01-15 14:42 ` [tarantool-patches] " Vladislav Shpilevoy 2018-12-29 10:14 ` [PATCH v3 2/6] [RAW] swim: introduce failure detection component Vladislav Shpilevoy 2019-01-09 13:48 ` Konstantin Osipov [this message] 2019-01-15 14:42 ` [tarantool-patches] " Vladislav Shpilevoy 2018-12-29 10:14 ` [PATCH v3 3/6] [RAW] swim: introduce a dissemination component Vladislav Shpilevoy 2018-12-29 10:14 ` [PATCH v3 4/6] [RAW] swim: keep encoded round message cached Vladislav Shpilevoy 2018-12-29 10:14 ` [PATCH v3 5/6] [RAW] swim: send one UDP packet per EV_WRITE event Vladislav Shpilevoy 2019-01-09 13:53 ` [tarantool-patches] " Konstantin Osipov 2019-01-15 14:42 ` [tarantool-patches] " Vladislav Shpilevoy 2018-12-29 10:14 ` [PATCH v3 6/6] [RAW] swim: introduce payload Vladislav Shpilevoy 2019-01-09 13:58 ` [tarantool-patches] " Konstantin Osipov 2019-01-15 14:42 ` [tarantool-patches] " 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=20190109134809.GE20509@chai \ --to=kostja@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=vdavydov.dev@gmail.com \ --subject='Re: [tarantool-patches] [PATCH v3 2/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