[tarantool-patches] [PATCH v2 1/3] swim: store sender UUID in swim io tasks

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed Apr 24 23:21:58 MSK 2019


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)





More information about the Tarantool-patches mailing list