Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org
Cc: kostja@tarantool.org
Subject: [tarantool-patches] [PATCH v2 1/3] swim: store sender UUID in swim io tasks
Date: Wed, 24 Apr 2019 23:21:58 +0300	[thread overview]
Message-ID: <e1a52c0016f2504af0be31862eb2e83ccffea10c.1556137229.git.v.shpilevoy@tarantool.org> (raw)
In-Reply-To: <cover.1556137229.git.v.shpilevoy@tarantool.org>

Struct swim_task is an asynchronous task generated by the SWIM
core and scheduled to be sent when a next EV_WRITE event appears.

It has a callback 'complete' called when the task finally sent
its packet into the network. In this callback a next SWIM round
step can be scheduled, or set a deadline for a ping. Usually it
requires to know to which member the packet was sent. for this
UUID is required, but swim_task operates by inet addresses only.

At this moment UUID necessity can be bypassed via container_of
or via some queues, but it is not so once suspicion component is
introduced.

The patch adds sender's UUID to struct swim_task.

Part of #3234
---
 src/lib/swim/swim_io.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/lib/swim/swim_io.h b/src/lib/swim/swim_io.h
index 88a7f424d..884680859 100644
--- a/src/lib/swim/swim_io.h
+++ b/src/lib/swim/swim_io.h
@@ -35,6 +35,7 @@
 #include "salad/stailq.h"
 #include "swim_transport.h"
 #include "tarantool_ev.h"
+#include "uuid/tt_uuid.h"
 #include <stdbool.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
@@ -217,6 +218,11 @@ struct swim_task {
 	 * A short description of the packet content. For logging.
 	 */
 	const char *desc;
+	/**
+	 * Sender's UUID used by ping tasks to schedule deadline
+	 * for an ACK.
+	 */
+	struct tt_uuid uuid;
 };
 
 /** Check if @a task is already scheduled. */
-- 
2.20.1 (Apple Git-117)

  reply	other threads:[~2019-04-24 20:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 20:21 [tarantool-patches] [PATCH v2 0/3] swim suspicion Vladislav Shpilevoy
2019-04-24 20:21 ` Vladislav Shpilevoy [this message]
2019-04-25 10:31   ` [tarantool-patches] Re: [PATCH v2 1/3] swim: store sender UUID in swim io tasks Konstantin Osipov
2019-04-24 20:21 ` [tarantool-patches] [PATCH v2 2/3] swim: introduce routing Vladislav Shpilevoy
2019-04-25 10:43   ` [tarantool-patches] " Konstantin Osipov
2019-04-25 13:50     ` Vladislav Shpilevoy
2019-04-25 13:55       ` Konstantin Osipov
2019-04-24 20:22 ` [tarantool-patches] [PATCH v2 3/3] swim: introduce suspicion Vladislav Shpilevoy
2019-04-25 10:44   ` [tarantool-patches] " Konstantin Osipov
2019-04-25 13:50 ` [tarantool-patches] Re: [PATCH v2 0/3] swim suspicion 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=e1a52c0016f2504af0be31862eb2e83ccffea10c.1556137229.git.v.shpilevoy@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH v2 1/3] swim: store sender UUID in swim io tasks' \
    /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