Typesofrecover Abl Eschedul Es

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Ty

pesofRecov
erabl
eSchedul
es
 
Ar
ecov
erabl
eschedul
emaybeanyoneoft
heseki
nds:
 

 
1.CascadingSchedule
2.CascadelessSchedul
e
3.St
rictSchedul

Cascadi
ngSchedul
e:
 Ifi
naschedul e,fai
lureofonet r
ansacti
oncausessever
alother
dependenttransactionstorol
lbackorabort
,thensuchascheduleis
call
edasa Cascadi ngSchedule or
 Cascadi
ngRoll
back 
or 
Cascading
Abort.
 Itsi
mplyleadst othewast ageofCPUt ime.
Exampl
e
Her
e,
 Transact
ionT2dependsont
ransact
ionT1.
 Transact
ionT3dependsont
ransact
ionT2.
 Transact
ion 
T4dependsont
ransact
ionT3.
I
nthisschedul
e,
 Thef
ail
ureoftr
ansactionT1causest
het r
ansactionT2to 
rol
lback.
 Ther
oll
backoftransacti
onT2causesthetransacti
onT3toroll
back.
 Ther
oll
backoftransacti
onT3causesthetransacti
onT4toroll
back.
Suchar ol
lbacki
scall
edasa CascadingRoll
back.

NOTE:
I
fthetransacti
onsT2,T3andT4wouldhavecommit
tedbeforethefai
l
ure
oftr
ansactionT1,t
hentheschedul
ewoul
dhavebeenir
recoverabl
e.

Cascadel
  essSchedul
e:
Ifi
naschedul e,at
ransact
ionisnotal
l
owedt oreadadatai
tem unt
ilt
he
l
asttransacti
onthathaswrit
teniti
scommi t
tedorabor
ted,
thensucha
scheduleiscall
edasa Cascadel
essSchedul
e.
I
not
herwor
ds,
 Cascadel
essschedul
eal
l
owsonl
ycommi
tt
edr
eadoper
ati
ons.
 Ther
efor
e,i
tav
oidscascadi
ngr
oll
backandt
hussav
esCPUt
ime.
 
Exampl
e-

NOTE-
 Cascadel
essschedul
eall
owsonl
ycommi t
tedr
eadoper
ati
ons.
 However,i
tal
lowsuncommit
tedwri
teoper
ati
ons.
 
Ex
ampl
e-

St
ri
ctSchedul
e:
I
finaschedul
e,at
ransact
ionisneit
heral
lowedtoreadnorwr
it
eadata
i
tem unt
ilt
hel
astt
ransact
ionthathaswri
tteni
tiscommitt
edorabor
ted,
t
hensuchaschedul
eiscalledasa St
ri
ctSchedul
e.
I
not
herwor
ds,
 Stri
ctschedul
eallowsonl
ycommittedr
eadandwrit
eoperat
ions.
 Clearl
y,st
ri
ctschedul
eimplement
smorerest
ri
cti
onsthancascadel
ess
schedule.
Ex
ampl
e-

Remember
-
 St
ri
ctschedulesaremorestri
ctthancascadelessschedul
es.
 Al
lstr
ictschedul
esarecascadel
essschedules.
 Al
lcascadelessschedul
esarenotstr
ictschedules.
 
S:r1(x)
,r2(
x),w1(x),
r1(y)
,w1(y),c1,
w2( x),c2;
(Str
ict)
S:r1(x)
,r2(
x),w2(x),
c2,w1( x),
r1(y),
w1( y),
c1;
(Str
ict)
S:r2(x)
,r1(
x),w1(x),
r1(y)
,w1(y),c1,
w2( x),c2;
(Str
ict)
S:r2(x)
,w2(x),c2,
r1(x),
w1(x),
r1( y
),w1(y),c1;
(Str
ict)
S:r1(x)
,r2(
x),w2(x),w1(x),
c2,r1(x),
r1(y),
c1;
(Cascadless)
S:r1(x)
,r2(
x),w1(x),w2(x),
c2,r1(y),
w1( y),
c1;
(Cascadless)
S:r1(x)
,r2(
x),w1(x),r2(
y),
w1( y),w2(x),c1,c2;
(Cascadless)
S:r3(x)
,r1(
x),w3(x),r1(
y),
w1( x),c3,r
1(x),c1;
(Cascadless)
S:r1(x)
,w1(x),r1(
y )
,w1( y
),r2(x),
c1,w2( x),
c2;
(Recoverable)
S:r1(x)
,w1(x),r1(
y )
,w1( y
),r2(x),
w2( x),
c1,c2;
(
Recov
erabl
e)

S:r1(
x),
w1(x),
r1(
y),
r2(
x),
w2(
x),
w1(y)
,c2,
c1;
(I
rr
ecoverabl
e)
S:r1(
x),
w1(x),
r1(
y),
r2(
x),
w2(
x),
c2,
w1( y)
,c1;
(I
rr
ecoverabl
e)
Conf
li
ctSer
ial
i
zabi
l
ity
Aschedul
eiscal
l
edconfl
ictser
ial
i
zabl
eifwecanconver
titi
ntoa
ser
ial
schedul
eaft
erswappingi
tsnon-
conf
li
cti
ngoper
ati
ons.

Conf
li
cti
ngOper
ati
ons

Thet
wooper
ati
onsbecomeconf
li
cti
ngi
fal
lcondi
ti
onssat
isf
y:
1.Bothbel
ongt oseparat
etr
ansact
ions.
2.Theyhavethesamedat ai
tem.
3.Theycontai
natleastonewri
teoperat
ion.

Note:Confl
ictpai
rsf
ort
hesamedat
ait
em ar
e:
Read-Wri
te
Writ
e-Writ
e
Writ
e-Read

Probl
em-
01:
Checkwhet
hert
hegi
venschedul
eSi
sconf
li
ctser
ial
i
zabl
eornot
-
S:
R1(
A),
R2(
A),
R1(
B),
R2(
B),
R3(
B),
W1(
A),
W2(
B)
Solut
ion-
Step-
01:
Li
stalltheconfl
ict
ingoper
ati
onsanddet
ermi
net
hedependency
betweenthetransacti
ons-
 R2(
A),
W1(
A)       (
T2 
→ T1)
 R1(
B),
W2(
B)       (
T1 
→ T2)
R3(
B),W2(B)
       (
T3 
→ T2)
 
St
ep-02:
Dr
awt hepr
ecedencegraph:

 Clear l
y,ther
eexistsacy cl
eintheprecedencegr aph.
 T her efore,t
hegivenscheduleSi snotconfl
ictserial
izabl
e.
Problem- 02:
Checkwhet hert
hegi venscheduleSisconfl
ictseriali
zableand
recov erableornot-S:R2(x),
W3(x),
W1(x),
W2(y),R2(z),
R4(x),
R4(y
)

 
Sol
uti
on-
CheckingWhet herSisConfl
ictSer
ial
i
zableOrNot
Step-
01:
Li
stalltheconfli
cti
ngoperat
ionsanddetermi
nethedependency
betweenthetransacti
ons-

 R2(
X),W3(X)       (T2 
→ T3)
 R2(
X),W1(X)       (T2 
→ T1)
 W3(X),W1(X)       
(T3 
→ T1)
 W3(X),R4(
X)       (T3 
→ T4)
 W1(X),R4(
X)       (T1 
→ T4)
 W2(Y),R4(
Y)       (T2 
→ T4)
St
ep-02:
Dr
awt heprecedencgraph-

 Clearl
y,t
her
eexi
stsnocycl
eint
heprecedencegraph.
 Therefor
e,t
hegi
venschedul
eSisconf
li
ctseri
ali
zable.

S
i
sconf
li
ctser
ial
i
zabl
e.

Si
sconf
li
ctser
ial
i
zabl
e.

You might also like