Modelling Compensation with Timed Process Algebra Simon Foster - - PowerPoint PPT Presentation

modelling compensation with timed process algebra
SMART_READER_LITE
LIVE PREVIEW

Modelling Compensation with Timed Process Algebra Simon Foster - - PowerPoint PPT Presentation

Compensation Cashew-S Behavioural Semantics Modelling Compensation with Timed Process Algebra Simon Foster S.Foster@dcs.shef.ac.uk Department of Computer Science University of Sheffield 11/06/2007 Simon Foster


slide-1
SLIDE 1

Compensation Cashew-S Behavioural Semantics

Modelling Compensation with Timed Process Algebra

Simon Foster S.Foster@dcs.shef.ac.uk

Department of Computer Science University of Sheffield

11/06/2007

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-2
SLIDE 2

Compensation Cashew-S Behavioural Semantics

Outline

Compensation Cashew-S Behavioural Semantics

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-3
SLIDE 3

Compensation Cashew-S Behavioural Semantics

What is compensation?

◮ A form of transaction support where you don’t have ACID

properties.

◮ A series of service interactions to try and undo half

completed work when failure occurs.

◮ The compensation is run in the reverse direction to the

normal forward flow.

◮ We split orchestration into discrete transaction blocks. ◮ Each component’s “forward flow” is associated with

compensation actions – “compensation flow”.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-4
SLIDE 4

Compensation Cashew-S Behavioural Semantics

Example compensable transaction

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-5
SLIDE 5

Compensation Cashew-S Behavioural Semantics

Compensable flow languages

◮ Our objective is a component-oriented compensable flow

language, with a general approach to compensable patterns.

◮ Compensation can be modelled in a number of different

ways:

◮ Centralised with Interruption; ◮ Distributed.

◮ Our framework should support all of these. ◮ Rather than introducing purpose specific constructs into a

language we want to use more canonical process algebraic constructs.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-6
SLIDE 6

Compensation Cashew-S Behavioural Semantics

Outline

Compensation Cashew-S Behavioural Semantics

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-7
SLIDE 7

Compensation Cashew-S Behavioural Semantics

Cashew-S

◮ An orchestration language. ◮ Originally based on OWL-S process model, though with

several extra features.

◮ Uses workflow patterns to compose performances. ◮ Performances may be

◮ Service interaction (Send, Receive etc.); ◮ Expression Evaluation; ◮ Workflow encapsulation; ◮ Transactions.

◮ All performances are named and have inputs and outputs. ◮ p represents a performance name, w a workflow name. ◮ The compensable fragment of this language follows.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-8
SLIDE 8

Compensation Cashew-S Behavioural Semantics

Transaction ::= Perform p Transaction CWorkflow TransList ::= Transaction | TransList; Transaction CWorkflow ::= Workflow w (Acceptors) (Offerors) CPattern CPattern ::= Seq (CPerfList) | Par (CPerfList) | Inter (CPerfList) | Conc z z z (TransList) | Choice (CPerfList) | Skip | Throw | Yield CPerf ::= AtomicPerformance | Compensation | CWfPerf | Transaction CWfPerf ::= Perform p CWorkflow Compensation ::= CPerf ÷ Performance CPerfList ::= CPerf | CPerfList; Connection | CPerfList; CPerf

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-9
SLIDE 9

Compensation Cashew-S Behavioural Semantics

Compensation in Cashew-S

◮ A transaction follows its forward flow as dictated by the

workflow.

◮ When an exception is raised the flow switches direction

and the compensations installed so far are run.

◮ Exceptions are not propogated beyond the transaction

block and compensations cannot fail.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-10
SLIDE 10

Compensation Cashew-S Behavioural Semantics

Outline

Compensation Cashew-S Behavioural Semantics

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-11
SLIDE 11

Compensation Cashew-S Behavioural Semantics

CaSiE

◮ CaSiE is a conservative extension of CCS. ◮ Adds discrete time in the form of multi-party

synchronisation with maximal progress.

◮ The “clock” acts as a synchronisation point. ◮ Clocks are excluded rather than included – they implicitly

exist and must be explicitly disabled.

◮ It also has a form of interruption, which allows any work

to be preempted.

◮ Both time and interruption can be localised to a

particular area of the system topology via hiding.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-12
SLIDE 12

Compensation Cashew-S Behavioural Semantics

Synchronous Hierarchies

◮ Maximal progress and clock hiding allow the formation of

synchronous hierarchies.

◮ In hiding a clock we define a synchronous block within

which all agents synchronise (whilst unobservable

  • utside).

◮ Since hiding forms converts a clock tick into a silent

action which in turn prevents any clocks outside from ticking.

◮ Thus silent an implicit ordering on the blocks’ behaviour

results.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-13
SLIDE 13

Compensation Cashew-S Behavioural Semantics

Synchronous Hiearchies

σ ρ E F G H

((E | F | G)/σ | H)/ρ

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-14
SLIDE 14

Compensation Cashew-S Behavioural Semantics

Localised Interruption

x E F G H

(E | F | G)/x | H

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-15
SLIDE 15

Compensation Cashew-S Behavioural Semantics

Equivalence theory

◮ Based on bisimulation with a congruence which abstracts

  • ver silent actions.

◮ Allows components to be check if they will behave the

same in all contexts.

◮ Facilitates component drop-in within an orchestration. ◮ Axiomatised over the non-interruptible fragment (CaSE).

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-16
SLIDE 16

Compensation Cashew-S Behavioural Semantics

Operational Semantics

◮ We give Cashew-S a semantics in terms of CaSiE. ◮ Each performance in a workflow is given a semantics and

associated with Scheduler which controls when it can run.

◮ Each workflow also has a Governor which communicates

with the environment.

◮ Then in turn each workflow may be wrapped into a

performance and itself becomes part of another workflow.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-17
SLIDE 17

Compensation Cashew-S Behavioural Semantics

Transactions

◮ Each transaction has a Sentinel, which handles

interruption by asking all sub-threads to yield and starting

  • ff the compensation process.

◮ The sentinel also handles the final “commit” by

broadcasting a z signal to all compensation schedulers etc.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-18
SLIDE 18

Compensation Cashew-S Behavioural Semantics

Agent architecture

Acceptor Offeror Sentinel Governor

r, r e, e a c

Performance Scheduler

Comp’sation Scheduler r e rc ec

c c

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-19
SLIDE 19

Compensation Cashew-S Behavioural Semantics

Compensation Pairs

◮ A compensation pair of the for p1 ÷ p2 is associated with

a Compensator agent.

◮ The Compensator handles “installation” of the

compensation performance when the forward performance finishes.

◮ Before successful completion, any compensation request

are passed directly onto the forward flow.

◮ However afterward they are passed onto the

compensation performance.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-20
SLIDE 20

Compensation Cashew-S Behavioural Semantics

Compensator

Comp’sation Performance Forward Performance Compensator

Compensable Performance

r e r e rc ec rc ec

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-21
SLIDE 21

Compensation Cashew-S Behavioural Semantics

Negotiation Protocol

Scheduler I am ready (r) OK, execute (e) I am done (✓) Performance Governor · · ·

◮ Simplified somewhat. ◮ There are also some clocks involved to define the current

phase of execution.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-22
SLIDE 22

Compensation Cashew-S Behavioural Semantics

Sequential Workflow

Gov Sched1 Sched2 Sched3 p1 p2 p3 t t t r e r e e r r e

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-23
SLIDE 23

Compensation Cashew-S Behavioural Semantics

Sequential Workflow with Compensation

Gov Sched1 Sched2 Sched3 p1 p2 p3 t t t r e r e e r r e CS1 CS2 CS3 t t rc ec rc ec rc ec

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-24
SLIDE 24

Compensation Cashew-S Behavioural Semantics

Workflow and Performance Phases

σw

1

σw

2

σw

3

ρw

1

ρw

2

σp

1

σp

2

ρp

1

ρp

2

◮ Phases dictate the current macro state that a component

is in, and allows agents to share the state.

◮ Each phase has an associated clock. ◮ σ clocks tick during the “normal” behaviour of a

components, ρ clocks tick during exception handling.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-25
SLIDE 25

Compensation Cashew-S Behavioural Semantics

Par Scheduling

σw

1

r e σw

2

σw

3

Governor

σw

1

r e ✓ σp

2

σw

3

σp

1

σw

2

✓ r e τ

Scheduler Performance

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-26
SLIDE 26

Compensation Cashew-S Behavioural Semantics

Par Scheduling + Compensation

σw

1

r e rc ρw

1

ec ρw

2

σw

2

σw

3

Governor

σw

1

r e ρw

1

ρw

2

✓ σp

2

ρw

1

σw

3

σp

1

σw

2

ρw

1

σp

1

σp

2

z ρw

1

ρp

1

ρw

1

ec rc ρp

2

ρw

2

ρw

2

ρw

1

Scheduler Compensation Scheduler

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra

slide-27
SLIDE 27

Compensation Cashew-S Behavioural Semantics

Conclusion

◮ We have outlined a simplified model for compensation

using timed process algebra.

◮ Our aim is to use this to give a semantics to different

patterns of compensation, which can be used within Cashew-S.

◮ We are also working on an implementation of this for an

  • rchestration engine in the functional programming

language Haskell.

Simon Foster S.Foster@dcs.shef.ac.uk Modelling Compensation with Timed Process Algebra