[tarantool-patches] Re: [PATCH 1/2] swim: introduce broadcast tasks

Konstantin Osipov kostja at tarantool.org
Thu Apr 11 15:57:53 MSK 2019


* Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [19/04/10 21:01]:
> When a cluster is just created, no one knows anyone. Broadcast
> helps to establish some initial relationships between members.
> 
> This commit introduces only an interface to create broadcast
> tasks from SWIM code. The next commit uses this interface to
> implement ping broadcast.

> +/**
> + * Broadcast task. Besides usual task fields, stores a list of
> + * interfaces available for broadcast packets. The task works
> + * multiple times, each time sending a packet to one interface.
> + * After completion it is self-deleted.
> + */
> +struct swim_bcast_task {

    Please explain in the comment why you need a task - you may
    only broadcast when a socket is writable, so use a generic way to 
    interact with the transport. Please mention why you create a
    single task, not multiple - no particular reason, just to
    create fewer tasks and do less error checking for failed
    resources. Please mention in a comment to swim_broadcast that
    we send a broadcast message to all interfaces which are
    support IP protocol and broadcast messages. 


Otherwise the patch is OK to push.

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov




More information about the Tarantool-patches mailing list