Tapahtumanhallinnan pulmakohtia ja ratkaisuja

Samankaltaiset tiedostot
Tapahtumanhallinnan pulmakohtia ja ratkaisuja

Tapahtumanhallinnan pulmakohtia ja ratkaisuja

1. SIT. The handler and dog stop with the dog sitting at heel. When the dog is sitting, the handler cues the dog to heel forward.

Efficiency change over time

Capacity Utilization

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

C++11 seminaari, kevät Johannes Koskinen

Results on the new polydrug use questions in the Finnish TDI data

Choose Finland-Helsinki Valitse Finland-Helsinki

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

IIO30220 Database Management / Tietokannan hallinta TAPAHTUMIEN HALLINTA JOUNI HUOTARI ( )

Returns to Scale II. S ysteemianalyysin. Laboratorio. Esitelmä 8 Timo Salminen. Teknillinen korkeakoulu

National Building Code of Finland, Part D1, Building Water Supply and Sewerage Systems, Regulations and guidelines 2007

Other approaches to restrict multipliers

The CCR Model and Production Correspondence

Salasanan vaihto uuteen / How to change password

HELIA 1 (14) Outi Virkki Tiedonhallinta

HAAGA-HELIA Heti-09 1 (14) ICT05: Tiedonhallinta ja Tietokannnat O.Virkki Transaktionkäsittely

Ajettavat luokat: SM: S1 (25 aika-ajon nopeinta)

Uusi Ajatus Löytyy Luonnosta 4 (käsikirja) (Finnish Edition)

PAINEILMALETKUKELA-AUTOMAATTI AUTOMATIC AIR HOSE REEL

LYTH-CONS CONSISTENCY TRANSMITTER

KONEISTUSKOKOONPANON TEKEMINEN NX10-YMPÄRISTÖSSÄ

Tutkimusdata ja julkaiseminen Suomen Akatemian ja EU:n H2020 projekteissa

Curriculum. Gym card

Alternative DEA Models

7.4 Variability management

BLOCKCHAINS AND ODR: SMART CONTRACTS AS AN ALTERNATIVE TO ENFORCEMENT

Exercise 1. (session: )

16. Allocation Models

AYYE 9/ HOUSING POLICY

TIEKE Verkottaja Service Tools for electronic data interchange utilizers. Heikki Laaksamo

1. Liikkuvat määreet

make and make and make ThinkMath 2017

Tietorakenteet ja algoritmit

The Viking Battle - Part Version: Finnish

FIS IMATRAN KYLPYLÄHIIHDOT Team captains meeting

4x4cup Rastikuvien tulkinta

Network to Get Work. Tehtäviä opiskelijoille Assignments for students.

Information on preparing Presentation

Jussi Klemola 3D- KEITTIÖSUUNNITTELUOHJELMAN KÄYTTÖÖNOTTO

Use of spatial data in the new production environment and in a data warehouse

Miten koulut voivat? Peruskoulujen eriytyminen ja tuki Helsingin metropolialueella

Slides for Chapter 11: Time and Global State

Tarua vai totta: sähkön vähittäismarkkina ei toimi? Satu Viljainen Professori, sähkömarkkinat

Microsoft Lync 2010 Attendee

anna minun kertoa let me tell you

RINNAKKAINEN OHJELMOINTI A,

Sisällysluettelo Table of contents

Group 2 - Dentego PTH Korvake. Peer Testing Report

Uusia kokeellisia töitä opiskelijoiden tutkimustaitojen kehittämiseen

Biojätteen keruu QuattroSelect - monilokerojärjestelmällä Tiila Korhonen SUEZ

LX 70. Ominaisuuksien mittaustulokset 1-kerroksinen 2-kerroksinen. Fyysiset ominaisuudet, nimellisarvot. Kalvon ominaisuudet

You can check above like this: Start->Control Panel->Programs->find if Microsoft Lync or Microsoft Lync Attendeed is listed

BPEL4WS Business Process Execution Language for Web Services. ITK E54 kevät 2005 Ville Seppänen

Kaivostoiminnan eri vaiheiden kumulatiivisten vaikutusten huomioimisen kehittäminen suomalaisessa luonnonsuojelulainsäädännössä

Ohjelmistoarkkitehtuurit Kevät 2016 Johdantoa

EARLY LEARNING PLAN / ENGLANTI VARHAISKASVATUSSUUNNITELMA

SIMULINK S-funktiot. SIMULINK S-funktiot

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

Bounds on non-surjective cellular automata

Plasmid Name: pmm290. Aliases: none known. Length: bp. Constructed by: Mike Moser/Cristina Swanson. Last updated: 17 August 2009

MUSEOT KULTTUURIPALVELUINA

9/11/2015 MOBILITY TOOL+ ERASMUS+ Learning Mobility of Individuals. M a n a g e m e n t. I s s u e. T o o l

Hankkeen toiminnot työsuunnitelman laatiminen

Operatioanalyysi 2011, Harjoitus 2, viikko 38

Ohjelmointikielet ja -paradigmat 5op. Markus Norrena

EUROOPAN PARLAMENTTI

VUOSI 2015 / YEAR 2015

FinFamily Installation and importing data ( ) FinFamily Asennus / Installation

ENE-C2001 Käytännön energiatekniikkaa. Aloitustapaaminen Osa II: Projekti- ja tiimityö

Rotarypiiri 1420 Piiriapurahoista myönnettävät stipendit

Julkaisun laji Opinnäytetyö. Sivumäärä 43

Työsuojelurahaston Tutkimus tutuksi - PalveluPulssi Peter Michelsson Wallstreet Asset Management Oy

BDD (behavior-driven development) suunnittelumenetelmän käyttö open source projektissa, case: SpecFlow/.NET.

Tork Paperipyyhe. etu. tuotteen ominaisuudet. kuvaus. Väri: Valkoinen Malli: Vetopyyhe

7 Sulautettujen järjestelmien suunnittelumallit. OhAr Marko Leppänen

Encapsulation. Imperative programming abstraction via subprograms Modular programming data abstraction. TTY Ohjelmistotekniikka

Asiakaspalautteen merkitys laboratoriovirheiden paljastamisessa. Taustaa

CASE POSTI: KEHITYKSEN KÄRJESSÄ TALOUDEN SUUNNITTELUSSA KETTERÄSTI PALA KERRALLAAN

Travel Getting Around

FinFamily PostgreSQL installation ( ) FinFamily PostgreSQL

Green Growth Sessio - Millaisilla kansainvälistymismalleilla kasvumarkkinoille?

Helsinki Metropolitan Area Council

812336A C++ -kielen perusteet,

Siirtymä maisteriohjelmiin tekniikan korkeakoulujen välillä Transfer to MSc programmes between engineering schools

Valuation of Asian Quanto- Basket Options

TM ETRS-TM35FIN-ETRS89 WTG

Metsälamminkankaan tuulivoimapuiston osayleiskaava

Data protection template

Convergence of messaging

TM ETRS-TM35FIN-ETRS89 WTG

The role of 3dr sector in rural -community based- tourism - potentials, challenges

Rekisteröiminen - FAQ

Osavuosikatsaus JUKKA RINNEVAARA CEO

TM ETRS-TM35FIN-ETRS89 WTG

Mat Seminar on Optimization. Data Envelopment Analysis. Economies of Scope S ysteemianalyysin. Laboratorio. Teknillinen korkeakoulu

21~--~--~r--1~~--~--~~r--1~

( ( OX2 Perkkiö. Rakennuskanta. Varjostus. 9 x N131 x HH145

Olet vastuussa osaamisestasi

Transkriptio:

Tapahtumanhallinnan pulmakohtia ja ratkaisuja TJT E54 Kehittämismenetelmät ja arkkitehtuurit liiketoiminnassa Kevät 2006 Ville Seppänen <rissepp@cc.jyu.fi> ACID Atomicity? Consistency? Isolation? Durability? 1

Tapahtuman ominaisuudet: Jakamattomuus (atomicity) Tapahtuman järjestelmään tekemät muutokset vahvistetaan () ainoastaan mikäli kaikki T:n operaariot onnistuvat. Muussa tapauksessa T keskeytetään (abort) Virheen sattuessa järjestelmään mahdollisesti tehdyt muutokset peruutetaan (roll-back, backward error recovery) siten, että järjestelmän alkuperäinen tila palautetaan lokitietojen perusteella Tapahtuma vs. Operaatio? Tapahtuma T = operaatiot t 1,..., t n Esim 1. T = Siirretään 100 tililtä A tilille B t 1 = Luetaan A:n saldo AS. t 2 = Kirjoitetaan AS = AS 100 t 3 = Luetaan B:n saldo BS t 4 = Kirjoitetaan BS = BS + 100 Esim 2. T = Käsitellään Teuvon tilaus koskien CD-levyä Musa t 1 = Vähennetään Musa:n varastomäärää t 2 = Lähetetään Teuvolle Musa t 3 = Lähetetään Teuvolle lasku 2

Tapahtuman ominaisuudet: Johdonmukaisuus (consistency) T:n järjestelmän tilaan tekemien muutosten tulee vastata kuvatussa ilmiössä tapahtuvia muutoksia ja muutosten tulee tapahtua järjestelmän eheysvaatimusten (integrity constraints) rajoissa Useimmissa tapauksissa järjestelmä on väistämättä epäjohdonmukaisessa tilassa jossain T:n välivaiheessa. Eheys tarkastetaan tavallisesti vasta T:n pyytäessä vahvistusta (deferred integrity constraints) Tapahtuman ominaisuudet: Johdonmukaisuus (consistency) State n ACID State n+1 ACID State n+2 abort abort write(a, (A-10)) read(b) write(b, (B+10)) Temporary inconsistency 3

Tapahtuman ominaisuudet: Eriytyvyys (isolation) Järjestelmän samanaikaisesti suorittamat tapahtumat täytyy eristää toisistaan; ts. Ne eivät saa päästä käsiksi epäjohdonmukaisessa tilassa oleviin resursseihin (vrt. edellinen kalvo) Virheelliset tulokset Ketjuuntuvat peruutukset (cascading rollback) Sarjallistuvuusvaatimus (ei sarjallisen T:n tulos sama kuin jos kunkin T:n operaatiot suoritettaisiin peräkkäin) Hallintakeinoina mm. optimistinensamanaikaisuuden hallinta, aikaleimaus, lukitusmenetelmät Sopiva menetelmä tapauskohtaisesti Tapahtuman ominaisuudet: Eriytyvyys (isolation) write(a, (A+10)) Update loss write(a, (A+10)) abort Dirty read write(a, (A+10)) write(a, (A+10)) read(b) read(b) write(b, (B-10)) read(c) write(c, (C+10)) read(c) SUM=A+B+C Incorrect summary (A+B+C=100) Inconsistent read write(a, (A+10)) 4

Tapahtuman ominaisuudet: Pysyvyys (durability) Tapahtuman järjestelmään tekemät muutokset eivät saa kadota tahattomasti tai tapaturmaisesti Hajautettu tapahtumanhallinta 5

Kaksivaiheinen vahvistus (2-phase protocol) Atomic ment protocol An algorithm that ensures that all the processes involved in a distributed transaction either or abort Coordination process Responsible for controlling the overall atomicity Controls the voting A number of participating processes Execute parts of a distributed transaction Kaksivaiheinen vahvistus (2-phase protocol) Voting procedure phase one The coordinator sends vote requests to all participants When a participant receives the vote request, it replies by voting either Yes or No, according to whether it is able to carry out the task Participants that voted Yes start waiting for a comfirmation message from the coordinator. Participants that voted No can unilateraly abort 6

Kaksivaiheinen vahvistus (2-phase protocol) Voting procedure phase two The coordinator collects all vote messages If all the participants voted Yes the coordinator decides to and sends Commit messages to all participants Otherwise, the coordinator decides to abort and sends Abort messages to all participants that voted Yes According to the received message, a participant decides to or abort Kaksivaiheinen vahvistus (2-phase protocol) It is possible that messages may not arrive due to a failure and processes may be waiting forever: A timeout mechanism must be able to interrupt the waiting period In addition, the coordinator may attach the list of participants to the vote request message and thereby let the participants to know each other: Cooperative termination protocol 7

Cooperative termination protocol If participant p comes across the timeout while waiting for the Commit or Abort message from the coordinator, it can request this from the participant q If q has already decided to (or abort) it sends a Commit (or Abort) to p In the case that q has not voted yet it can decide to abort and send Abort to p If q has voted Yes but has not received the final Commit or Abort request from the coordinator it cannot help p in making the decision Nested transactions A mechanism to facilitate transactions in distributed systems (Moss 1981) A tree-like model with parents, children, toplevel (root), and leaves 8

Nested transactions Rules A parent can spawn any number of children Any number of children may be active concurrently Parent can t access data when its children are alive A child can inherit a lock held by any ancestor On child, its locks are inherited (antiinheritance) by parent Nested transactions Rules, continued Commit dependency: parent can only after all its children terminate (/abort) Abort dependency: On parent abort, even updates of ted children are undone Updates persist only if all ancestors 9

Nested transactions Nested transactions Intra-transactional parallelism Safe concurrency Reduced response time Intra-transactional recovery control Finer control of error handling Improves availability System modularity Composition of separately developed modules 10

Save points Can be seen as a check point in a transaction that forces the system to save the state of the running application and return a save point identifier for future reference Instead of removing an entire transaction after a failure of single operation (subprocess) backward recovery can return the last valid state of the transaction saved in the save point reference Compensation & Sagas Long-living and distributed transactions are not reasonable to implement as a single ACID transaction Keep the resources locked for the long periods of time, which can significantly delay the of other simultaneously executed transactions Deadlock frequency grows with the fourth power of the transaction size 11

Compensation & Sagas Atomic ment protocols ease the implementation of ACID transactions in distributed systems but futher transactions to become long living Backward recovery is expensive and difficult to implement The idea of compensating transactions (processes, operations) was introduced to simulate the transactional properties in such applications Compensation & Sagas In Saga model (Garcia-Molina & Salem 1987) a long living transaction is broken up into a collection of subtransactions that interleave with other transactions The results of a subtransaction can be made immediately visible af ter it is ted 12

Compensation & Sagas Saga subtransactions can be executed independently but they must finally form an atomic unit Should any of subtransactions fail the failed transaction is aborted and already ted subtransactions are undone Removing the ted transaction means that results of subsequent transactions may become inconsistent and cause cascading rollbacks Instead of removing the results of failed transaction by using rollback the idea of compensating transaction is introduced Compensation & Sagas Each Saga subtransaction T i is provided with a compensating transaction C i If the compensation is not needed saga T 1, T 2,..., T n will execute as a sequence of transactions In case of compensation the sequence would be T 1, T 2,..., T k, C k,..., C 2, C 1 where 0 k < n, and C k is a predefined compensating transaction of T i A compensating transaction doesn t necessarily restore the state that prevailed before the execution of T i but rather undoes operation(s) of T i from a semantic point of view 13

Compensation & Sagas Contrary to traditional backward recovery mechanism, which is based on compensating operations automatically deduced from the schedule, semantically compensating transactions may not be automatically generated Even relatively simple actions (such as subtraction) must follow the integrity constraints Everything cannot be undone For example, real actions with real consequences : impossible to undo but it may be possible to override the effect with a new action Committed acceptable & aborted acceptable termination states: business considerations Forward recovery Combining the save points, compensation and recovery of failed transaction Transaction that caused the failure is aborted using the conventional rollback Committed transactions are undone in reversed order using their compensating counterparts until the save point is found (backward recovery) Finally, the transaction is restarted from the location of found save point (forward recovery) 14

Forward recovery Save points Forward recovery When recovering, it s not always feasible or even possible to complete the transaction by trying to re-execute the original steps again However, it s possible that the same objective can be achieved with different ways. Alternative methods of forward recovery should be considered during the process design phase 15

Transactional processes Typical scenario: a top-level process consists of subcomponents that are logically connected to the higherlevel process but are executed virtually independently A global transaction a collage of all separate transactions that are included in the process often long-living and distributed Each global transaction can be divided into a set of local transactions can be represented as a tree of hierarchically ordered tasks, which may also include manual operations Transactional processes The lowest level consists of DB ACID transactions 16

Transactional processes Transactional processes 17