Sunteți pe pagina 1din 2

DDOS 4307 COMP4307 Assignment Database logging and recovery Due 27/ /2003

!"e Durability as#ect o$ AC%D transactions is im#lemented t"roug" logging and t"e care$ul ordering o$ guaranteed &rites to dis'( %n t"is assignment you "ave to demonstrate "o& t"is mec"anism &or's and guarantees t"e recovery o$ committed data a$ter $ailures( )ou "ave to write a simple simulator o$ t"e logging and recovery #art o$ a database server and a report that uses the results of your simulation to s"o& "o& logging and recovery &or's( !"e simulated database server s"ould maintain a #ool o$ database bu$$ers* log c"anges to a log bu$$er* &rite $ull log bu$$ers to a log $ile* #rocess commit re+uests* initiate $u,,y c"ec'#oints every $e& -say .0/ transactions* recover $rom simulated $ailures -bot" a##lication $ailure and system $ailure/ and do anyt"ing else you t"in' is necessary( !"e simulator s"ould read a scri#t $ile t"at s#eci$ies a se+uence o$ actions to be carried out( !"is scri#t $ile s"ould be ca#able o$ s#eci$ying t"e $ollo&ing actions -and anyt"ing else you t"in' is needed $or your re#ort/0 1ead record into a bu$$er 4#date bu$$er Create record Delete record Commit 5ailA## 5ailSystem -t23* db record3/ -t23* db record3* ne& data value/ -t23* db record3* ne& data value/ -t23* db record3/ -t23/ -t23/

)ou only "ave to simulate $ailures so normal $ile &rites &ill be ade+uate 6 you don7t "ave to cras" your com#uter and recover $rom real log $iles( )ou &ill need to simulate multi#le concurrent transactions* $illing log bu$$ers &it" c"anges $rom a number o$ concurrent transactions( !"e a$ter values $or your log records &ill be t"e data values #assed in &it" t"e o#eration and you can use t"e db record number as t"e be$ore value $or any record t"at you are $etc"ing $rom t"e database on dis' or deleting( )ou do not "ave to simulate t"e database on dis' at all* but you do "ave to simulate t"e database bu$$er #ool "eld in memory and its management( !o sim#li$y t"is tas'* assume t"at database records are e2actly t"e same si,e -say 20 bytes/ and t"at eac" record com#letely $ills one database bu$$er( )ou s"ould allocate a $i2ed number o$ database bu$$ers -say 20 to .00/* #er"a#s in an array( )ou &ill "ave to do sim#le memory management o$ t"is bu$$er #ool* $inding a suitable bu$$er &"en you need to read a record in $rom 8dis'7 6 normally one t"at is eit"er unused or does not contain data t"at cannot yet be &ritten bac' to t"e database( )ou s"ould trace everyt"ing t"at "a##ens 6 reads and &rites to t"e #"ysical database* bu$$er #ool actions* log bu$$er actions* commits and c"ec'#oints 6 and anyt"ing else t"at ma'es to easier to understand t"e algorit"ms involved(

!"e #ur#ose o$ t"e simulation is to illustrate your discussion o$ t"e logging and recovery mec"anisms* so t"in' about &"at you &ant to illustrate and t"en build t"e a##ro#riate scri#ts( )ou need* at a minimum* to discuss &"at "a##ens on a##lication $ailure and a$ter a system $ailure( )ou "ave to discuss recovery a$ter a media $ailure -dis' cras"/ but you s"ould not try to simulate it( 1emember 6 t"e #ur#ose o$ t"e simulation is only to illustrate your discussion* so don7t get carried a&ay &it" concurrent t"reads* sync"ronised dis' &rites* de$erred log &rites and ot"er real9&orld o#timisations 6 sim#licity is good( :and in bot" your code and a re#ort t"at discusses t"e algorit"ms involved in im#lementing Durability* using your in#ut scri#ts and trace out#uts to s"o& &"at is "a##ening( 30; o$ t"e mar' &ill be $or t"e code and 70; &ill be $or t"e re#ort -including t"e out#ut #roduced by your code/( )ou &ill get better mar's t"roug" sim#le clear e2#lanations o$ &"at your traces are illustrating( )ou may $ind c"a#ter < o$ Princi#les o$ !ransaction Processing -=ernstein > ?e&comer/ use$ul in understanding t"e algorit"ms used to im#lement Durability(

S-ar putea să vă placă și