vector clocks
play

Vector Clocks Collin J. Fidge, 1988. Timestamps in Message-Passing - PowerPoint PPT Presentation

Vector Clocks Collin J. Fidge, 1988. Timestamps in Message-Passing Systems That Preserve the Partial Order Order of events without global clock What happens when? event message time process A total order of events Lamport clocks 5 4 4


  1. Vector Clocks Collin J. Fidge, 1988. Timestamps in Message-Passing Systems That Preserve the Partial Order

  2. Order of events without global clock What happens when? event message time process

  3. A total order of events Lamport clocks 5 4 4 3 3 3 2 2 2 1 1 1 same timestamp: any (consistent) order

  4. A total order of events Lamport clocks

  5. A total order of events Lamport clocks Too little information: Shows only one possible interleaving of events.

  6. A partial order of events The ”happens before” relation same process transitivity message minimal relation

  7. A partial order of events The ”happens before” relation

  8. A partial order of events Vector clocks A timestamp of a vector clock is a vector of integer clocks – one clock per process. • How does vector clocks work? • Can vector clocks represent the ”happens before” relation?

  9. Vector clocks Rules �� ������������������������ [ � , � , . . . , � ] � �� ������������������������������ ������ ����������� �� ���������������������������������������� �� ������������������������� ����������������������� ����������������������������������������� ������� ���������������������������������������������� ������������������������������������ �� �����������������������������

  10. Vector clocks Rule 4 ��� � �������������������������� � ������������������� ����� � ������������������� ������������������������ ������� transit time out of order ��� ( � [ � ] , � [ � ] + � ) �� � = � � � � [ � ] = ��� ( � [ � ] , � [ � ]) ���������

  11. Vector clocks Example [3 ,5 ,4] [4,0,0] [3 ,4,2] [3 ,0,0] [0,0,3] [3 ,3 ,2] [0,0,2] [0,2,2] [2,0,0] [0,0,1 ] [0,1,0] [1,0,0]

  12. Vector clocks A relation on events ��� � � ��� � � ���������������� � ��� � ������������ � ��� � � ��� � � � ��� � � � ������������������������������� � �������������������� → �������������� � � → � � ⇐ ⇒ � � � [ � ] < � � � [ � ] � �����������������������������������������������

  13. Vector clocks Example (again) � � → � � ⇐ ⇒ � � � [ � ] < � � � [ � ] [3 ,5 ,4] [4,0,0] same [3 ,4,2] process transitivity [3 ,0,0] [0,0,3] [3 ,3 ,2] message [0,0,2] [0,2,2] [2,0,0] [0,0,1 ] [0,1,0] [1,0,0] minimal relation

  14. Vector clocks The ”happens before” relation �������������������������������������������������������� ������������������������������������� → ����������� �� �������������������������� �� ����������������������������� �� ������������ �� ����������������

  15. Vector clocks The ”happens before” relation ��� � ��� � ���������������� ������������ � � ������ � � → � � ����������������� � � � [ � ] < � � � [ � ] � ���������������� ����������������� �� ������������������������������ ������ ����������� �� �����������������������������

  16. Vector clocks The ”happens before” relation ��� � � ��������������������� � � ������������������������� � �������� ������ � � → � � ����������������� � � � [ � ] < � � � [ � ] � ����������� � − � ���������������������� � � ���������� � � �������������� � ��� ( � � − � [ � ] , � � � [ � ] + � ) �� � = � � � � [ � ] = ��� ( � � − � [ � ] , � � � [ � ]) ��������� ������� � � � [ � ] < ��� ( � � − � [ � ] , � � � [ � ] + � ) ������������� �����

  17. Vector clocks The ”happens before” relation ��� ������������� ��� � � � ��� � �������������������� � � � ��� � ������������� ������ � � � � � ��� � � � � � � ������� ��������� � � � [ � ] < � � � [ � ] � �� � = � ���� � � � [ � ] � � � � [ � ] � ������������������ �� ����������������������������� �� � � = � ��������������������������� � � � [ � ] � � � � [ � ] � ����� � � � [ � ] < � � � [ � ] � � � � [ � ] ������ � � � � � �

  18. Vector clocks The ”happens before” relation ���� → ����� �������� ��������������������������������� ����������� ������������������������������������� � � → � � ⇐ ⇒ � � � [ � ] < � � � [ � ] ����������������� � � � [ � ] ������������������������������ ����� ���������������������������������� ��������������� �������� ������������� � � ��������������� � � �

  19. Vector clocks Conclusion Vector clocks can describe the ”happens before” relation!

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend