History

tipc: receive group membership events via member socket

Like with any other service, group members' availability can be subscribed for by connecting to be topology server. However, because the events arrive via a different socket than the member socket, there is a real risk that membership events my arrive out of synch with the actual JOIN/LEAVE action. I.e., it is possible to receive the first messages from a new member before the corresponding JOIN event arrives, just as it is possible to receive the last messages from a leaving member after the LEAVE event has already been received. Since each member socket is internally also subscribing for membership events, we now fix this problem by passing those events on to the user via the member socket. We leverage the already present member synch- ronization protocol to guarantee correct message/event order. An event is delivered to the user as an empty message where the two source addresses identify the new/lost member. Furthermore, we set the MSG_OOB bit in the message flags to mark it as an event. If the event is an indication about a member loss we also set the MSG_EOR bit, so it can be distinguished from a member addition event.

Jon Maloy committed 9 years ago

Commit ae236fb1 parent 31c82a25 files · +101 −33Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/tipc.h+1−0
@@ -238,6 +238,7 @@ struct sockaddr_tipc { · 237 unmodified lines
238 * Flag values238 * Flag values
239 */239 */
240#define TIPC_GROUP_LOOPBACK 0x1 /* Receive copy of sent msg when match */240#define TIPC_GROUP_LOOPBACK 0x1 /* Receive copy of sent msg when match */
241#define TIPC_GROUP_MEMBER_EVTS 0x2 /* Receive membership events in socket */
241 242
242struct tipc_group_req {243struct tipc_group_req {
243 __u32 type; /* group id */244 __u32 type; /* group id */