Till KTH:s startsida Till KTH:s startsida

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.

Lärare Johan Montelius skapade sidan 8 juli 2012

Johan Montelius redigerade 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

kommenterade 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.
En användare har tagit bort sin kommentar
En användare har tagit bort sin kommentar
kommenterade 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 :-)

kommenterade 23 september 2012

Found the same problems. Working on it...

En användare har tagit bort sin kommentar
Lärare kommenterade 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 redigerade 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

Lärare kommenterade 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 redigerade 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)

Lärare kommenterade 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 redigerade 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)

Lärare kommenterade 25 september 2012

And now the indentation is ok :-)

kommenterade 4 oktober 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).

kommenterade 7 oktober 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).

kommenterade 7 oktober 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 redigerade 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 redigerade 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

kommenterade 2 oktober 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... :)

Lärare kommenterade 2 oktober 2016

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

kommenterade 2 oktober 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 :)

Lärare kommenterade 3 oktober 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?

kommenterade 4 oktober 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