implementation definition implementation correctness
play

Implementation:definition Implementation:correctness - PDF document

Sofar 2processconsensuscannotbesolvedusing Consensus:partII registers Nprocessconsensuscanbesolveduisng registersand' 2processconsensuscanbesolvedusing


  1. So�far… � 2�process�consensus�cannot�be�solved�using� Consensus:�part�II registers � N�process�consensus�can�be�solved�uisng registers�and�' � 2�process�consensus�can�be�solved�using� FDC�� Summer�Term�2007 registers�and�T&S�or�queues�(but�not�3� process�consensus) Max�Planck�Institute�for�Software� Systems Why�consensus�is�interesting? � ������������������ � � ������������������ Because�it�is� universal� ! What�is�an� object� ? Object�O�is�defined�by�the�tuple (Q,R,S,σ): � If�we�can�solve�consensus�among�N� � Set�of�states�Q processes,�then�we�can� implement every� � Set�of�outputs�R object�shared�by�N�processes� � Set�of�operations�S � Sequential�specification�σ,�a�subset�of� SxQxRxQ: � A�key�to�implement�a�generic�fault�tolerant� � (o,q,r,q’)�is�in�σ � if�operation�o�is�applied�to�an� service�(replicated�state�machine) object�in�state�q,�then�the�object� can return�r� and�change�its�state�to�q’ � � � ������������������ � ������������������ Deterministic�objects�and�binding Implementing�an�object Using�only base objects,�an�implementation�of�an� object�O=(Q,R,S,σ)�exports�the�operations�in�S�to� � An�operation�applied�to�a� deterministic the�processes�and�creates�an�illusion�that�an� atomic object�O�is�available object�results�in�exactly�one�(output,state)� enq(x) in�RxQ,�i.e.,�σ can�be�seen�a�function�SxQ �>� deq() RxQ Base� ok x objects � We�assume�that�every�process�can� attach� Queue itself to�every�object�at�any�point�of� deq() empty comutation (softwired binding�model) � � � ������������������ � ������������������ 1

  2. Implementation:�definition Implementation:�correctness A�distributed�algorithm�A�that,�for�each� A�(wait�free)�implementation�A�is�correct�if� operation�o�in�S�and�for�every�pi,�describes� in�every�well�formed�run�of�A the�corresponding�sequence�of�steps�on�the� � ������������� every�operation�run�by�pi� base�objects returns�in�a�finite�number�of�steps�of�pi� � ���������������������� ≈ operations�“appear” instantaneous�(the�corresponding� history is� strictly�linearizable ) A�run�of�A�is� well�formed if�no�process�invokes�a� � The�formal�definition�follows new�operation�on�the�implemented�object�before� returning�from�the�old�one � � � ������������������ � ������������������ Histories Legal�histories A�history�of�a�given�run�of�A�is�a�sequence�of� A�sequential�history�is� legal if�it�satisfies�the� invocation�and�responses�on�the�implemented� sequential�specification�of�the�implemented� object�in�that�run object E.g.,�p1�>Q.enqueue(x),�p2�>Q.dequeue(),p1�>ok,���p2�>x,… A�history�is�sequential�if�every�invocation�is� Example:�LIFO�queues: followed�by�a�corresponding�response Every�dequeue()�returns�the�argument�of� E.g.,�p1�>Q.enqueue(x),�p1�>ok,�p2�>Q.dequeue(),��p2�>x,… the�last�enqueued element (A�sequential�history�has�no�concurrent�operations) � �� � ������������������ � ������������������ Complete�operations�and�completions Complete�operations�and�completions �������������� ������������� An�operation�op�is� complete in�H�if�H� p1 contains�invocation�and�response�of�op ����������������� A� completion of�H�is�a�complete�history�H’ that�contains�all�complete�operations�of�H� p2 ��������� ����� and�a� subset of�incomplete�operations�of�H� � completed�with� matching responses p3 ����������������������������������������������������� ������������������������ � ����������� ���!� �� �� � ������������������ � ������������������ 2

  3. Strict�linearizability Complete�operations�and�completions A�finite�history�H�is� strictly�linearizable if�there� ������������ ������������ exists�H’,�a�legal�sequential�completion�of�H,�that� preserves�the�precedence�relation�of�H: p1 ���������������� op1�precedes�op2�in�H�=>�op1�precedes�op2���in�H’ p2 �������� (all�complete�operation�and�a�subset�of�incomplete� operations�can�be� linearized ) p3 An�implementation�is�strictly�linearizable if�every� ����������������������������������������������������� finite�run�of�it�produces�a�strictly�linearizable ������ � ���������� history �� �� � ������������������ � ������������������ Universal�construction Linearization ������������� ������������� p1 "#������� [Herlihy,�1991]�If�N�processes� ������������������������� can�solve�consensus,�then�N�processes�can� p2 (wait�free)�implement�every�object� ��������� O=(Q,R,S,σ) p3 ������������������������������������������������������ �������������� � ���������� �� �� � ������������������ � ������������������ Universal�construction:�idea Universal�construction:�variables Shared�abstractions: Every�process�that�has�a�pending�operation� N�atomic�registers�R[0,…,N�1],�initially�Ø does�the�following: N�process�consensus�instances�C[1],�C[2],�… � Publish�the�corresponding� request Local�variables�for�each�process�pi: integer� seq ,�initially�0�� � Collect�published�requests�and�use� //�the�number�of�executed�operations� consensus�instances�to�serialize�them:�the� integer� k ,�initiaqlly 0� processes�agree�on�the�order�in�which�the� //�the�number�of�linearized batches�of� requests�are�executed //�requests� sequence� linearized ,�initially�empty� //the�sequence�of�linearized requests �� �� � ������������������ � ������������������ 3

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