Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Causal-Consistent Reversibility in a Tuple-Based Language Joint work with Elena.

Slides:



Advertisements
Similar presentations
1 Ivan Lanese Computer Science Department University of Bologna Italy Managing faults and compensations in SOCK Joint work with Claudio Guidi, Fabrizio.
Advertisements

Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Chapter 16.
1 Reversibility for Recoverability Ivan Lanese Computer Science Department FOCUS research group University of Bologna/INRIA Bologna, Italy.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Fault in the Future Joint work with Gianluigi Zavattaro and Einar Broch Johnsen.
CMPT 401 Summer 2007 Dr. Alexandra Fedorova Lecture X: Transactions.
Transactions A process that reads or modifies the DB is called a transaction. It is a unit of execution of database operations. Basic JDBC transaction.
Recovery from Crashes. Transactions A process that reads or modifies the DB is called a transaction. It is a unit of execution of database operations.
A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1.
CMPT Dr. Alexandra Fedorova Lecture X: Transactions.
Recovery from Crashes. ACID A transaction is atomic -- all or none property. If it executes partly, an invalid state is likely to result. A transaction,
Common Sub-expression Elim Want to compute when an expression is available in a var Domain:
1 Ivan Lanese Computer Science Department University of Bologna Italy Exploiting user-definable synchronizations in graph transformation.
1 The SOCK SAGA Ivan Lanese Computer Science Department University of Bologna Italy Joint work with Gianluigi Zavattaro.
ACID A transaction is atomic -- all or none property. If it executes partly, an invalid state is likely to result. A transaction, may change the DB from.
1 Synchronization strategies for global computing models Ivan Lanese Computer Science Department University of Bologna.
1 Ivan Lanese Computer Science Department University of Bologna Roberto Bruni Computer Science Department University of Pisa A mobile calculus with parametric.
1 SOCK and JOLIE from the formal basis to a service oriented programming language Ivan Lanese Computer Science Department University of Bologna Italy Joint.
1 Ivan Lanese Computer Science Department University of Bologna Italy Behavioural Theory for SSCC Joint work with Luis Cruz-Filipe, Francisco Martins,
1 Static vs dynamic SAGAs Ivan Lanese Computer Science Department University of Bologna/INRIA Italy.
Physical design. Stage 6 - Physical Design Retrieve the target physical environment Create physical data design Create function component implementation.
1 Joint work with Claudio Antares Mezzina (INRIA), Jean-Bernard Stefani (INRIA) and Alan Schmitt (INRIA) Controlling Reversibility in Rhopi Ivan Lanese.
1 Ivan Lanese Computer Science Department University of Bologna Italy Concurrent and located synchronizations in π-calculus.
Normal forms for Context-Free Grammars
Recap from last time: live variables x := 5 y := x + 2 x := x + 1 y := x y...
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Fault in the Future Joint work with Gianluigi Zavattaro and Einar Broch Johnsen.
1 Ivan Lanese Computer Science Department University of Bologna Italy On the expressive power of primitives for compensation handling Joint work with Catia.
1 Ivan Lanese Computer Science Department University of Bologna Italy Behavioural Theory at Work: Program Transformations in a Service-centred Calculus.
An algebra of Connectors for modeling CommUnity with Tiles joint work with Roberto Bruni Ugo Montanari Dipartimento di Informatica Università di Pisa Ivan.
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
1 Ivan Lanese Computer Science Department University of Bologna Italy Streaming Services in SSCC Joint work with Francisco Martins, Vasco Vasconcelos and.
Transactions and Recovery
1 Reversibility for Concurrent Interacting Systems Ivan Lanese Focus research group Computer Science and Engineering Department University of Bologna/INRIA.
1 Joint work with Michael Lienhardt (PPS), Claudio Antares Mezzina (Trento), Jean-Bernard Stefani (INRIA) and Alan Schmitt (INRIA) Reversibility in Concurrency.
1 Transaction Management Overview Chapter Transactions  Concurrent execution of user programs is essential for good DBMS performance.  Because.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Chapter 16.
Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Chapter 18.
Dynamic Choreographies Safe Runtime Updates of Distributed Applications Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Joint.
Formalizing the Asynchronous Evolution of Architecture Patterns Workshop on Self-Organizing Software Architectures (SOAR’09) September 14 th 2009 – Cambrige.
Towards Global and Local Types for Adaptation Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Joint work with Mario Bravetti,
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 3 (26/01/2006) Instructor: Haifeng YU.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Amending Choreographies Joint work with Fabrizio Montesi and Gianluigi Zavattaro.
1 Causal-Consistent Reversible Debugging Ivan Lanese Focus research group Computer Science and Engineering Department University of Bologna/INRIA Bologna,
Recursion. What is recursion? Rules of recursion Mathematical induction The Fibonacci sequence Summary Outline.
Simultaneously Learning and Filtering Juan F. Mancilla-Caceres CS498EA - Fall 2011 Some slides from Connecting Learning and Logic, Eyal Amir 2006.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Decidability Results for Dynamic Installation of Compensation Handlers Joint.
Database Systems Recovery & Concurrency Lecture # 20 1 st April, 2011.
1 Reversible Debugging Ivan Lanese Focus research group Computer Science and Engineering Department University of Bologna/INRIA Bologna, Italy Joint work.
1 Joint work with Claudio Antares Mezzina and Jean-Bernard Stefani Controlled Reversibility and Compensations Ivan Lanese Focus research group Computer.
Transactions.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
Transaction Management and Recovery, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Chapter 18.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Francesco Tiezzi IMT Advanced Studies Lucca Causal-Consistent Reversibility in a Tuple-Based Distributed Language Joint work with Elena Giachino, Ivan.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Adaptive Choreographies Joint work with Mila Dalla Preda, Jacopo Mauro and Maurizio.
MA/CSSE 474 Theory of Computation How many regular/non-regular languages are there? Closure properties of Regular Languages (if there is time) Pumping.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Causal-Consistent Reversibility in a Tuple-Based Distributed Language Joint work.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Matching Logic An Alternative to Hoare/Floyd Logic
Transaction Management Overview
Operating System Reliability
Operating System Reliability
Transaction Management Overview
Transaction Management Overview
Internet of Things A Process Calculus Approach
open problems Claudio Antares Mezzina
Operating System Reliability
Transaction Management Overview
Transaction Management Overview
Presentation transcript:

Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Causal-Consistent Reversibility in a Tuple-Based Language Joint work with Elena Giachino, Claudio Antares Mezzina and Francesco Tiezzi

Map of the talk l Reversibility l Klaim l Uncontrolled reversibility in Klaim l Controlling reversibility: roll operator l Conclusions

What is reversibility? Reversibility everywhere –chemistry/biology –quantum computing –state space exploration –debugging –… The possibility of executing a computation both in the standard, forward direction, and in the backward direction, going back to a past state

Our aim l We want to exploit reversibility for programming reliable concurrent and distributed systems –To make a system reliable we want to escape “bad” states –If a bad state is reached, reversibility allows one to go back to some past “good” state l We think that reversibility is the key to –Understand existing patterns for programming reliable systems, e.g. checkpointing, rollback-recovery, transactions, … –Combine and improve them –Develop new patterns

Reverse execution of a sequential program l Recursively undo the last action –Computations are undone in reverse order –To reverse A;B first reverse B, then reverse A l We want the Loop Lemma to hold –From state S, doing A and then undoing A should lead back to S –From state S, undoing A (if A is in the past) and then redoing A should lead back to S

Avoiding loss of information l Undoing computational actions may not be easy –Computational actions may cause loss of information –X = 5 causes the loss of the past value of X l Restrict to languages that never lose information –X = X + 1 does not lose information l Take languages that would lose information, and save this information –X = 5 becomes reversible by recording the old value of X

Reversibility and concurrency l The sequential definition, recursively undo the last action, is no more applicable l Which is the last action in a concurrent setting? –Executions of many actions may overlap –For sure, if an action A caused an action B, A could not be the last one l Causal-consistent reversibility: recursively undo any action whose consequences (if any) have already been undone

Causal-consistent reversibility

Reversibility and concurrency l Two sequential actions should be undone in reverse order l Two concurrent actions can be undone in any order –Choosing an interleaving for them is an arbitrary choice –It should have no impact on the possible reverse behaviors

Map of the talk l Reversibility l Klaim l Uncontrolled reversibility in Klaim l Controlling reversibility: roll operator l Conclusions

Klaim l Coordination language based on distributed tuple spaces –Linda operations for creating and accessing tuples –Tuples accessed via pattern-matching l Klaim nets composed by distributed nodes containing processes and data (tuples) l We consider a subset of Klaim called μKlaim

μKlaim syntax

Example

Map of the talk l Reversibility l Klaim l Uncontrolled reversibility in Klaim l Controlling reversibility: roll operator l Conclusions

Making μKlaim reversible

l We have to deal with some peculiarities of μKlaim causality structure l Read dependencies –Two reads on the same tuple should not create dependences –If the out creating the tuple is undone then reads on the same tuple should be undone too l Localities –Localities are resources and establish dependences –To undo a newloc one has to undo all the operations on the created locality

RμKlaim syntax

Example

execute in in l 2 execute out in l 2 execute in in l 3 execute out in l 3

Example execute in in l 2 execute out in l 2 execute in in l 3 execute out in l 3 it needs to perform a backward step

Properties l The forward semantics of RμKlaim is an annotated version of the semantics of μKlaim l The Loop Lemma holds –i.e., each reduction in RμKlaim has an inverse l RμKlaim is causally consistent

Concurrency in RμKlaim l Two transitions are concurrent unless ‒ They use the same resource ‒ At least one transition does not use it in read-only modality l Resources defined by function λ on memories l Read uses the tuple in read-only modality l All primitives but newloc use the target locality in read- only modality

Causal consistency l Causal equivalence identifies traces that differ only for ‒ swaps of concurrent transitions ‒ simplifications of inverse transitions l Casual consistency: there is a unique way to go from one state to another up to causal equivalence –causal equivalent traces can be reversed in the same ways –traces which are not causal equivalent lead to distinct nets

Is uncontrolled reversibility enough? l Uncontrolled reversibility is a suitable setting to understand and prove properties about reversibility l... but it is not suitable for programming (reliable) systems –Actions are done and undone nondeterministically –A program may diverge by doing and undoing the same action forever –No way to keep good results

Map of the talk l Reversibility l Klaim l Uncontrolled reversibility in Klaim l Controlling reversibility: roll operator l Conclusions

Controlling reversibility l In reliable systems –Normal execution is forward –Backward execution is used to escape bad states l We add to μKlaim a roll operator –To undo a given past action –Together with all its consequences (and only them) l We call CRμKlaim the extension of μKlaim with roll

CRμKlaim syntax

l From l We get l When we undo the out we need to restore the in l The formal semantics is quite tricky Example

Results l CRμKlaim is a controlled version of RμKlaim l It inherits its properties

Map of the talk l Reversibility l Klaim l Uncontrolled reversibility in Klaim l Controlling reversibility: roll operator l Conclusions

Summary l We defined uncontrolled and controlled causal-consistent reversibility for μKlaim l Two peculiar features taken into account –Read dependences »Allow to avoid spurious dependencies –Localities

Future work l Defining a low-level controlled semantics closer to an actual implementation l Study the relationships with patterns for reliability Using the controlled semantics to define a reversible debugger for μKlaim l Extend the approach to mainstream languages –Interesting preliminary results for actor based languages

Thanks! Questions?

μKlaim semantics

Evaluation-closed relation A relation is evaluation closed if it is closed under active contexts N1 N1′ implies N1 || N2 N1′ || N2 and (νl) N1 (νl)N1′ and under structural congruence N≡M M′ ≡N′ implies N N′ μKlaim semantics The μKlaim reduction relation is the smallest evaluation- closed relation satisfying the rules in previous slide

CRμKlaim semantics l M is complete and depends on k l N t : if the undone action is an in, we should release the tuple l N l : we should not consume the roll locality, unless created by the undone computation l N : resources consumed by the computation should be released