Static vs dynamic SAGAs - PowerPoint PPT Presentation

Loading...

PPT – Static vs dynamic SAGAs PowerPoint presentation | free to download - id: 7c0e95-MDY4M



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Static vs dynamic SAGAs

Description:

Static vs dynamic SAGAs Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Roadmap Long running transactions A journey in static SAGAs A ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 33
Provided by: IvanL162
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Static vs dynamic SAGAs


1
Static vs dynamic SAGAs
Ivan Lanese Computer Science Department University
of Bologna/INRIA Italy
2
Roadmap
  • Long running transactions
  • A journey in static SAGAs
  • A journey in dynamic SAGAs
  • Static vs dynamic
  • Conclusions

3
Roadmap
  • Long running transactions
  • A journey in static SAGAs
  • A journey in dynamic SAGAs
  • Static vs dynamic
  • Conclusions

4
Today computing systems
  • Computing systems of increasing complexity
  • Many components
  • Interactions
  • Distribution
  • Many sources of unreliability
  • Other components
  • Communication middleware (wireless, )
  • Computing systems have to provide reliable
    services to the users
  • Important to handle unexpected events

5
Long running transactions
  • Unexpected events make activities to abort
  • One has to manage the abort to allow the whole
    application to reach a consistent state
  • Impossible to have perfect rollback (as for ACID
    transactions)
  • Irreversible actions sending of an email
  • Penalties booking of an airplane ticket
  • Approaches based on long running transactions and
    compensations
  • A compensation is executed to take the system to
    a consistent state

6
Formal models for long running transactions
  • Different formal models for long running
    transactions
  • To clearly specify the expected behavior
  • To prove properties of systems
  • Interaction based compensations
  • Extending name passing calculi such as
    pi-calculus with operators for error handling
  • c-join, webp, dcp,
  • Compensable flow composition approaches
  • Analyzing how compensations of simple activities
    are composed
  • cCSP, StAC, SAGAs calculi,
  • Need for some order

7
Comparing models
  • A difficult task
  • Models differ in many aspects
  • Atomic activities, communication, state
  • Different levels of abstraction
  • Different primitives
  • We will concentrate on one kind of model, SAGAs,
    and one particular aspect, static vs dynamic
    compensations

8
Static vs dynamic
  • Static the possible orders of execution of
    compensations depend only on the structure of the
    term
  • Example 1 to compensate PQ execute the
    compensation of Q then the compensation of P
  • Example 2 to compensate PQ execute concurrently
    the compensations of P and of Q
  • Dynamic the possible orders of execution of
    compensations may depend on runtime information
  • Example to compensate PQ execute the
    compensations of P and Q in reverse order of
    completion of P and Q

9
Static vs dynamic in the literature
  • Static vs dynamic for interaction based
    compensations at ESOP 2010 (with Vaz, Ferreira)
  • Classic SAGAs calculi (Bruni, Melgratti,
    Montanari, POPL 2005) are static
  • Dynamic SAGAs calculus at SEFM 2009 (with
    Zavattaro)
  • Which are the relations between static and
    dynamic SAGAs calculi?

10
Something more on SAGAs calculi
  • The basic building blocks are compensable actions
    AB
  • Execute activity A, if the SAGA aborts execute
    activity B as compensation for A
  • SAGAs can be composed
  • sequence PQ
  • parallel PQ
  • nested P

11
Which semantics for SAGAs?
  • Many possible choices
  • Static vs dynamic
  • Interruption vs no interruption
  • Centralized vs distributed compensations
  • We consider the semantics with interruption and
    centralized compensation
  • Interruption for avoiding unnecessary
    computations
  • Semantics of distributed compensations
    unrealistic for real systems

12
Nesting
  • Useful for modeling complex systems and for
    refinement
  • Allows to see a SAGA as an activity
  • Present in the original proposal (POPL 2005)
  • Never defined for static SAGAs with interruption
    and centralized compensation nor for dynamic
    SAGAs
  • Second aim of the paper extending the two
    approaches with nesting
  • Not a trivial issue

13
Roadmap
  • Long running transactions
  • A journey in static SAGAs
  • A journey in dynamic SAGAs
  • Static vs dynamic
  • Conclusions

14
Static SAGA semantics
  • Big-step semantics
  • G is an environment describing basic activities
  • The final outcome of a SAGA can be
  • success
  • abort
  • failure, if a compensation aborts
  • Observation a the activities that have been
    successfully executed
  • Compensation ß starting compensation
  • Compensation ß1 final compensation

15
Sample static rule
  • A rule for sequential composition
  • Observations can also include parallel
    composition
  • We refer to the paper for the whole semantics

16
Static SAGA semantics
  • Activities are executed and compensations stored
    for later retrieval
  • Executed in case of failure by the innermost SAGA
    (centralized compensation)
  • If a branch aborts and/or fails, other branches
    should be notified
  • Abort makes the other branches to compensate
  • Fail is catastrophic and blocks all the
    activities
  • Can only occur with nesting

17
Branch outcome notification
  • Notification blocks execution of other branches
  • We need to model incomplete executions
  • abort because of external abort (successful
    compensation)
  • failure because of external failure (no
    compensation)
  • failure because of external abort and failure
    of the compensation
  • Parallel composition rules describe the allowed
    combinations
  • Notifications should be also propagated to
    subSAGAs

18
Roadmap
  • Long running transactions
  • A journey in static SAGAs
  • A journey in dynamic SAGAs
  • Static vs dynamic
  • Conclusions

19
Dynamic SAGA semantics
  • Small-step semantics
  • The final result of a dynamic SAGA can be
    either an intermidiate process P or a final
    outcome , or
  • Observation a can be an activity or empty
  • A SAGA gives rise to computations to reach a
    final outcome

20
Sample dynamic rules
  • A few rules for sequential composition
  • Allow to compute inside P and to complete P
    execution successfully
  • Again, we refer to the paper for the whole
    semantics

21
Dynamic SAGA execution
  • When a subSAGA executes it produces some items of
    compensation
  • Compensations of subSAGAs and of the main SAGA
    should not mix
  • Auxiliary syntax is needed
  • Running SAGA P,ß
  • SAGA executing P with stored compensation ß

22
Compensation execution
  • Running compensations should not be interrupted
    by external aborts
  • Should execute in a protected way
  • Auxiliary syntax is needed again
  • ß is a running compensation
  • Two possible causes for compensation execution
  • Internal if compensation is successful then the
    SAGA is successful
  • External the SAGA can not succeed anyway, abort
    is at the upper level
  • Two forms of running compensations ß and ß

23
Roadmap
  • Long running transactions
  • A journey in static SAGAs
  • A journey in dynamic SAGAs
  • Static vs dynamic
  • Conclusions

24
Static vs dynamic SAGAs
  • Two different intuitions about compensation order
  • Big-step vs small-step semantics
  • Which is the relation between them?
  • Are the two definitions coherent?
  • Good hint of correctness

25
Towards the correspondance
  • Static big-steps correspond to sets of possible
    dynamic computations
  • Big-step with label (AB)C corresponds to the
    set of computations with sequences of labels
    A,B,C or B,A,C
  • Steps with empty labels are deleted

26
From dynamic to static
  • For each complete dynamic computation there is a
    static big-step with a compatible label and with
    the same outcome
  • Proof by induction on the SAGA structure
  • Auxiliary results to relate partial computations
    to big-steps with outcomes , or

27
From static to dynamic
  • For each static big-step there is a dynamic
    computation with a compatible label and with the
    same outcome
  • There is not one such computation for each
    possible interleaving of the parallel
    observations
  • Dynamic SAGAs have more constraints on order of
    execution of actions
  • In ABCD compensations B and D can be executed
    in any order in static SAGAs
  • In dynamic SAGAs if A is executed before C then D
    has to be executed before B
  • ACBD is valid for static SAGAs but not for
    dynamic SAGAs

28
Comparison outcomes
  • Static and dynamic SAGAs are strongly related
  • Static SAGAs allow for more nondeterminism in the
    order of compensation of parallel actions
  • The strong relation is a good hint about the
    correctness of the formalization

29
Roadmap
  • Long running transactions
  • A journey in static SAGAs
  • A journey in dynamic SAGAs
  • Static vs dynamic
  • Conclusions

30
Results
  • Formalization of
  • Nested static SAGAs with interruption and
    centralized compensations
  • Nested dynamic SAGAs
  • Proved a strong relationship between the two
    models

31
Future work
  • Fully analyze dynamic SAGAs
  • Define a realistic semantics for SAGAs with
    interruption and distributed compensations (WADT
    2010)
  • Continue to study the relationships between
    different approaches to long running transactions
  • Still lot of work to do
  • Hierarchical vs flat

32
The end
  • Thanks!
  • Questions?
About PowerShow.com