Groupy - a group membership service

In this assignment you will implement a group membership service. If everything works ok, you will not only see colors but the same colors.

This is an assignment were you will implement a group membership service that provides atomic multicast. The aim is to have several application layer processes with a coordinated state i.e. they should all perform the same sequence of state changes. A node that wish to perform a state change must first multicast the change to the group so that all nodes can execute it. Since the multicast layer provides total order, all nodes will be synchronized. The problem in this assignment is that all nodes need to be synchronized even though nodes may come and go (crash). As you will see it is not as trivial as one might first think.

To pass, complete the assignment up to, and including, section 3, and be prepared to discuss the questions under section 4 at the reporting seminar. Write up your observations in a short report and be prepared to connect the nodes in a group at the reporting seminar. Section 4 also includes a task for extra bonus. 

This version uses the wxWidgets library.

At the corresponding reporting seminar you are required to present and demonstrate results of your homework, discuss your findings and problems (if any) you have faced, pros and cons of your solution, and your suggestions on how it can be improved. Specifically for this homework, be prepared to discuss the questions under section 4 at the reporting seminar.

Teacher Johan Montelius created page 8 July 2012

Johan Montelius edited 20 September 2012

In this assignment you will implement a group membership service. If everything works ok, you will not only see colours but the same colours.

This is an assignment were you will implement a group membership service that provides atomic multicast. The aim is to have several application layer processes with a coordinated state i.e. they should all perform the same sequence of state changes. A node that wish to perform a state change must first multicast the change to the group so that all nodes can execute it. Since the multicast layer provides total order, all nodes will be synchronized. The problem in this assignment is that all nodes need to be synchronized even though nodes may come and go (crash). As you will see it is not as trivial as one might first think.

Complete the assignment up to, and including, section 3. Write up your observations in a short report and be prepared to connect the nodes in a class room wide group. On the seminars we will discuss the questions under section 4.


* groupy.pdf

commented 21 September 2012

In the code at the end of section 2.1:

  • Slave is in the function signature. It should be Slaves.
  • In the {mcast, Msg} clause: Unbound variable Peers is used.
  • in {join, Wrk, Peer} clause: _ is included in a message, which isn't allowed (erlang R15B01).
  • in {join, Wrk, Peer} clause: bcast/2 is called, but nothing indicates that the function should exist.
  • the whole function isn't indented correctly, but that is the least of its problems.
One user removed his/her comment
One user removed his/her comment
commented 21 September 2012

In the init function at the end of section 2.3:
I believe Grp ! {join, Self} should be changed to Grp ! {join, Master, Self}.

After fixing this and the other stuff i mentioned + running it in windows instead of arch linux, it seems to be working!

Cool stuff :-)

commented 23 September 2012

Found the same problems. Working on it...

One user removed his/her comment
Teacher commented 24 September 2012

Hi,  thanks for the commenst and sorry for the errros in the desciption but I'm sure that you will be abel to work your way around it. The tcl/tk gui is as you've seen depricated but I think it will still work? I'll port this to wx ... anyday soon.  Will update the .pdf with your fixes.

Johan Montelius edited 24 September 2012

In this assignment you will implement a group membership service. If everything works ok, you will not only see colours but the same colours.

This is an assignment were you will implement a group membership service that provides atomic multicast. The aim is to have several application layer processes with a coordinated state i.e. they should all perform the same sequence of state changes. A node that wish to perform a state change must first multicast the change to the group so that all nodes can execute it. Since the multicast layer provides total order, all nodes will be synchronized. The problem in this assignment is that all nodes need to be synchronized even though nodes may come and go (crash). As you will see it is not as trivial as one might first think.

Complete the assignment up to, and including, section 3. Write up your observations in a short report and be prepared to connect the nodes in a class room wide group. On the seminars we will discuss the questions under section 4.


* groupy.pdf

Teacher commented 24 September 2012

Ok, I've updated the description of teh assignment and think it is now consistent (have I compiled it,... no, ok, think it is).   Thanks for the corrections.

Johan Montelius edited 25 September 2012

In this assignment you will implement a group membership service. If everything works ok, you will not only see colours but the same colours.

This is an assignment were you will implement a group membership service that provides atomic multicast. The aim is to have several application layer processes with a coordinated state i.e. they should all perform the same sequence of state changes. A node that wish to perform a state change must first multicast the change to the group so that all nodes can execute it. Since the multicast layer provides total order, all nodes will be synchronized. The problem in this assignment is that all nodes need to be synchronized even though nodes may come and go (crash). As you will see it is not as trivial as one might first think.

Complete the assignment up to, and including, section 3. Write up your observations in a short report and be prepared to connect the nodes in a class room wide group. On the seminars we will discuss the questions under section 4.


* groupy.pdf (third try)

Teacher commented 25 September 2012

Ok, third try :-)   As you saw the code in the appendix did not quite correspond to the code in the text. I should not say that it does now but it might be closer.  

Johan Montelius edited 25 September 2012

In this assignment you will implement a group membership service. If everything works ok, you will not only see colours but the same colours.

This is an assignment were you will implement a group membership service that provides atomic multicast. The aim is to have several application layer processes with a coordinated state i.e. they should all perform the same sequence of state changes. A node that wish to perform a state change must first multicast the change to the group so that all nodes can execute it. Since the multicast layer provides total order, all nodes will be synchronized. The problem in this assignment is that all nodes need to be synchronized even though nodes may come and go (crash). As you will see it is not as trivial as one might first think.

Complete the assignment up to, and including, section 3. Write up your observations in a short report and be prepared to connect the nodes in a class room wide group. On the seminars we will discuss the questions under section 4.


* groupy.pdf (third tryfourth)

Teacher commented 25 September 2012

And now the indentation is ok :-)

commented 4 October 2013

For me there was a problem with the gui module. The graphical window was not updated, I solved it by adding hide and show to the color function.

color(Window, Color) ->
    wxWindow:setBackgroundColour(Window, Color),
    wxWindow:hide(Window),
    wxWindow:show(Window).

commented 7 October 2013

The best way is maybe to use the refresh function, thus you avoid closing and opening the windows each time the color changes (On Windows 7 at least).
color(Frame, Color) ->
    wxFrame:setBackgroundColour(Frame, Color),
    wxFrame:refresh(Frame).

commented 7 October 2014

Hello!

If you have any trouble with the GUI not updating its color, it could be that you have to add another line to refresh the Window yourself.

You can do this by refresh. For example:

color(Window, Color) ->
    wxWindow:setBackgroundColour(Window, Color),
    wxWindow:refresh(Window).

Johan Montelius edited 28 September 2015

In this assignment you will implement a group membership service. If everything works ok, you will not only see colours but the same colours.

This is an assignment were you will implement a group membership service that provides atomic multicast. The aim is to have several application layer processes with a coordinated state i.e. they should all perform the same sequence of state changes. A node that wish to perform a state change must first multicast the change to the group so that all nodes can execute it. Since the multicast layer provides total order, all nodes will be synchronized. The problem in this assignment is that all nodes need to be synchronized even though nodes may come and go (crash). As you will see it is not as trivial as one might first think.

Complete the assignment up to, and including, section 3. Write up your observations in a short report and be prepared to connect the nodes in a class room wide group. On the seminars we will discuss the questions under section 4.

This version uses the wxWidgets library.


* Groupy: a group membership service

Johan Montelius edited 28 September 2015

In this assignment you will implement a group membership service. If everything works ok, you will not only see colours but the same colours.

This is an assignment were you will implement a group membership service that provides atomic multicast. The aim is to have several application layer processes with a coordinated state i.e. they should all perform the same sequence of state changes. A node that wish to perform a state change must first multicast the change to the group so that all nodes can execute it. Since the multicast layer provides total order, all nodes will be synchronized. The problem in this assignment is that all nodes need to be synchronized even though nodes may come and go (crash). As you will see it is not as trivial as one might first think.

Complete the assignment up to, and including, section 3. Write up your observations in a short report and be prepared to connect the nodes in a class room wide group. On the seminars we will discuss the questions under section 4.

This version uses the wxWidgets library.


* Groupy: a group membership service
* worker.erl
* gui.erl
* test.erl

commented 2 October 2016

Question, the sequence numbers in the last part of the lab.. are they supposed to be the same for views and messages or separate sequence numbers for each of these? It's hard to understand from the assignment what is intended... :)

Teacher commented 2 October 2016

Why do we have sequence numbers? Do views have their own order or is it one order for all kind of messages?

commented 2 October 2016

To keep consistency and order, I'd say it's all one order but then we must resend views as views and messages as messages and so we need to keep track of whether the last saved message was a view or a message and the docs doesn't mention this at all which I think is misleading since they tend to be VERY explicit about most other things... therefore I hesitated and I'm now looking for a clarification :)

Teacher commented 3 October 2016

Any detail unclear is deliberately there to make you think about what your doing (and sometimes by random :-) 

Let's say your a slave and you have one thing in you pocket, the last thing you got from your master. Now the master dies, what should you do with the thing in your pocket? Does it matter if it's a regular message, a view or a coconut?

commented 4 October 2016

It does if we're not saving the entire tuple as the last message ;) a good ol' "gedanken wööörp" as we say in Swedish :D

Feedback News