The VIEW_SYNC protocol (which is useful only in JGroups versions 2.8 and earlier and should not be used in versions 2.9 and later) causes group members to periodically exchange their view of group membership with each other and, if discrepancies are found, cause GMS to update the official view based on these exchanges. This is in contrast to group membership information being updated only based on information from the coordinator.
This protocol is used to solve the problem of unreliable view dissemination: a coordinator responsible for disseminating views may potentially crash during view dissemination, resulting in group members having inconsistent views.
This protocol layer is supposed to appear just below GMS in the protocol stack.
avg_send_interval="60000" Average time interval to send views. Default value is 60000 ms. Value of 0 disables sending of VIEW_SYNC messages.
The protocol processes VIEW_SYNC_REQ, VIEW_SYNC, and VIEW_CHANGE events.
A VIEW_CHANGE event, representing a "normal" view change, is handled in a VIEW_SYNC layer by starting a task which periodically (using the avg_send_interval) sends out a VIEW_SYNC message to the group containing the current view of the protocol peer in question. This occurs only if the view received in VIEW_CHANGE has more than one member; periodic transmission is disabled if group membership falls to 1. Thus, VIEW_CHANGE events start and stop the periodic dissemination of views among peers. When VIEW_SYNC is not present in the stack, or turned off, view dissemination is handled by the coordinator only.
A VIEW_SYNC event (containing a peer's view of group membership) is handled by checking if the view received is "new" (has a more recent Lamport timestamp). If the view is new, the peer adopts the view (making a call to GMS); if it is not, it discards the view.
A VIEW_SYNC_REQ is used to request an updated view from group members. It appears this event is intended to enable view reconciliation from JMX. The event is handled in peers by sending them sending their current view in a VIEW_SYNC event to the group.