SlideShare a Scribd company logo
1 of 12
Top Schools in 
Ghaziabad 
By: 
school.edhole.com
Distributed Transactions 
 Transaction may access data at several sites. 
 Each site has a local transaction manager responsible for: 
 Maintaining a log for recovery purposes 
 Participating in coordinating the concurrent execution of the 
transactions executing at that site. 
 Each site has a transaction coordinator, which is responsible 
for: 
 Starting the execution of transactions that originate at the site. 
 Distributing subtransactions at appropriate sites for execution. 
 Coordinating the termination of each transaction that originates at the 
site, which may result in the transaction being committed at all sites 
or aborted at all sites. 
school.edhole.com 
Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, 
©Silberschatz, Database System Concepts 19.2 Korth and Sudarshan
Transaction System Architecture 
school.edhole.com 
Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, 
©Silberschatz, Database System Concepts 19.3 Korth and Sudarshan
System Failure Modes 
 Failures unique to distributed systems: 
 Failure of a site. 
 Loss of massages 
 Handled by network transmission control protocols such as TCP-IP 
 Failure of a communication link 
 Handled by network protocols, by routing messages via 
alternative links 
 Network partition 
 A network is said to be partitioned when it has been split into 
two or more subsystems that lack any connection between them 
– Note: a subsystem may consist of a single node 
 Network partitioning and site failures are generally 
indistinguishable. 
school.edhole.com 
Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, 
©Silberschatz, Database System Concepts 19.4 Korth and Sudarshan
Lecture-11 : Commit Protocols 
 Commit protocols are used to ensure atomicity across sites 
 a transaction which executes at multiple sites must either be 
committed at all the sites, or aborted at all the sites. 
 not acceptable to have a transaction committed at one site and 
aborted at another 
 The two-phase commit (2 PC) protocol is widely used 
 The three-phase commit (3 PC) protocol is more complicated 
and more expensive, but avoids some drawbacks of two-phase 
commit protocol. 
school.edhole.com 
Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, 
©Silberschatz, Database System Concepts 19.5 Korth and Sudarshan
Two Phase Commit Protocol (2PC) 
 Assumes fail-stop model – failed sites simply stop working, and 
do not cause any other harm, such as sending incorrect 
messages to other sites. 
 Execution of the protocol is initiated by the coordinator after the 
last step of the transaction has been reached. 
 The protocol involves all the local sites at which the transaction 
executed 
 Let T be a transaction initiated at site Si, and let the transaction 
coordinator at Si be Ci 
school.edhole.com 
Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, 
©Silberschatz, Database System Concepts 19.6 Korth and Sudarshan
Phase 1: Obtaining a Decision 
 Coordinator asks all participants to prepare to commit 
transaction Ti. 
 Ci adds the records prepare T to the log and forces log to stable 
storage 
 sends prepare T messages to all sites at which T executed 
 Upon receiving message, transaction manager at site 
determines if it can commit the transaction 
 if not, add a record no T to the log and send abort T message to 
Ci 
 if the transaction can be committed, then: 
 add the record ready T to the log 
 force all records for T to stable storage 
 send ready T message to Ci 
school.edhole.com 
Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, 
©Silberschatz, Database System Concepts 19.7 Korth and Sudarshan
Phase 2: Recording the Decision 
 T can be committed of Ci received a ready T message from all 
the participating sites: otherwise T must be aborted. 
 Coordinator adds a decision record, commit T or abort T, 
to the log and forces record onto stable storage. Once the record 
stable storage it is irrevocable (even if failures occur) 
 Coordinator sends a message to each participant informing it of 
the decision (commit or abort) 
 Participants take appropriate action locally. 
school.edhole.com 
Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, 
©Silberschatz, Database System Concepts 19.8 Korth and Sudarshan
Handling of Failures - Site Failure 
When site Si recovers, it examines its log to determine the fate of 
transactions active at the time of the failure. 
 Log contain commit T record: site executes redo (T) 
 Log contains abort T record: site executes undo (T) 
 Log contains ready T record: site must consult Ci to 
determine the fate of T. 
 If T committed, redo (T) 
 If T aborted, undo (T) 
 The log contains no control records concerning T replies that Sk 
failed before responding to the prepare T message from Ci 
 since the failure of Sk precludes the sending of such a 
response C1 must abort T 
 Sk must execute undo (T) 
school.edhole.com 
Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, 
©Silberschatz, Database System Concepts 19.9 Korth and Sudarshan
Handling of Failures- Coordinator Failure 
 If coordinator fails while the commit protocol for T is executing 
then participating sites must decide on T’s fate: 
1. If an active site contains a commit T record in its log, then T must 
be committed. 
2. If an active site contains an abort T record in its log, then T must 
be aborted. 
3. If some active participating site does not contain a ready T record 
in its log, then the failed coordinator Ci cannot have decided to 
commit T. Can therefore abort T. 
4. If none of the above cases holds, then all active sites must have a 
ready T record in their logs, but no additional control records 
(such as abort T of commit T). In this case active sites must 
wait for Ci to recover, to find decision. 
 Blocking problem : active sites may have to wait for failed 
coordinator to recover. 
school.edhole.com 
Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, 
©Silberschatz, Database System Concepts 19.10 Korth and Sudarshan
Handling of Failures - Network 
Partition 
 If the coordinator and all its participants remain in one partition, 
the failure has no effect on the commit protocol. 
 If the coordinator and its participants belong to several partitions: 
 Sites that are not in the partition containing the coordinator think the 
coordinator has failed, and execute the protocol to deal with failure 
of the coordinator. 
 No harm results, but sites may still have to wait for decision from 
coordinator. 
 The coordinator and the sites are in the same partition as the 
coordinator think that the sites in the other partition have failed, 
and follow the usual commit protocol. 
 Again, no harm results 
school.edhole.com 
Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, 
©Silberschatz, Database System Concepts 19.11 Korth and Sudarshan
Recovery and Concurrency Control 
 In-doubt transactions have a ready T, but neither a 
commit T, nor an abort T log record. 
 The recovering site must determine the commit-abort status of 
such transactions by contacting other sites; this can slow and 
potentially block recovery. 
 Recovery algorithms can note lock information in the log. 
 Instead of ready T, write out ready T, L L = list of locks held 
by T when the log is written (read locks can be omitted). 
 For every in-doubt transaction T, all the locks noted in the 
ready T, L log record are reacquired. 
 After lock reacquisition, transaction processing can resume; the 
commit or rollback of in-doubt transactions is performed 
concurrently with the execution of new transactions. 
school.edhole.com 
Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, 
©Silberschatz, Database System Concepts 19.12 Korth and Sudarshan

More Related Content

What's hot (11)

Chapter 14 Computer Architecture
Chapter 14 Computer ArchitectureChapter 14 Computer Architecture
Chapter 14 Computer Architecture
 
Distributed Transaction
Distributed TransactionDistributed Transaction
Distributed Transaction
 
6 two phasecommit
6 two phasecommit6 two phasecommit
6 two phasecommit
 
Operating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatzOperating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatz
 
Cs501 transaction
Cs501 transactionCs501 transaction
Cs501 transaction
 
Chapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatzChapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatz
 
Chapter17
Chapter17Chapter17
Chapter17
 
Ch15
Ch15Ch15
Ch15
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniques
 
What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...
 
9 fault-tolerance
9 fault-tolerance9 fault-tolerance
9 fault-tolerance
 

Viewers also liked

Power point reading meen picky pui
Power point reading meen picky puiPower point reading meen picky pui
Power point reading meen picky pui
iimeenie
 
Biju maio 2010
Biju maio 2010Biju maio 2010
Biju maio 2010
Quasetudo
 
Genre presentation
Genre presentationGenre presentation
Genre presentation
jamesmichie
 
[MobileDay52012_Appota] Đỗ Tuấn Anh
[MobileDay52012_Appota] Đỗ Tuấn Anh[MobileDay52012_Appota] Đỗ Tuấn Anh
[MobileDay52012_Appota] Đỗ Tuấn Anh
luuvt87
 
Workshop 1 11 fei eif online marketing presentation
Workshop 1 11 fei eif online marketing presentationWorkshop 1 11 fei eif online marketing presentation
Workshop 1 11 fei eif online marketing presentation
Haphan116
 
100 haiku (2012) altered
100 haiku (2012) altered100 haiku (2012) altered
100 haiku (2012) altered
kenmeharg
 
Creating A Search Strategy
Creating A Search StrategyCreating A Search Strategy
Creating A Search Strategy
lib100
 
Geewa Startup Camp Bratislava
Geewa Startup Camp BratislavaGeewa Startup Camp Bratislava
Geewa Startup Camp Bratislava
Miloš Endrle
 

Viewers also liked (20)

My Dream PC
My Dream PCMy Dream PC
My Dream PC
 
Power point reading meen picky pui
Power point reading meen picky puiPower point reading meen picky pui
Power point reading meen picky pui
 
Biju maio 2010
Biju maio 2010Biju maio 2010
Biju maio 2010
 
Top nonsensical halloween costumes
Top nonsensical halloween costumesTop nonsensical halloween costumes
Top nonsensical halloween costumes
 
ISS_5
ISS_5ISS_5
ISS_5
 
92 97
92 9792 97
92 97
 
STI Summit 2011 - Linked services
STI Summit 2011 - Linked servicesSTI Summit 2011 - Linked services
STI Summit 2011 - Linked services
 
Presentacion ppa tierragrata
Presentacion ppa tierragrataPresentacion ppa tierragrata
Presentacion ppa tierragrata
 
Genre presentation
Genre presentationGenre presentation
Genre presentation
 
00 (a) prefácio
00 (a) prefácio00 (a) prefácio
00 (a) prefácio
 
Issue6
Issue6Issue6
Issue6
 
Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39
Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39
Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39
 
[MobileDay52012_Appota] Đỗ Tuấn Anh
[MobileDay52012_Appota] Đỗ Tuấn Anh[MobileDay52012_Appota] Đỗ Tuấn Anh
[MobileDay52012_Appota] Đỗ Tuấn Anh
 
Workshop 1 11 fei eif online marketing presentation
Workshop 1 11 fei eif online marketing presentationWorkshop 1 11 fei eif online marketing presentation
Workshop 1 11 fei eif online marketing presentation
 
100 haiku (2012) altered
100 haiku (2012) altered100 haiku (2012) altered
100 haiku (2012) altered
 
Loma812
Loma812Loma812
Loma812
 
Issue20
Issue20Issue20
Issue20
 
Creating A Search Strategy
Creating A Search StrategyCreating A Search Strategy
Creating A Search Strategy
 
Geewa Startup Camp Bratislava
Geewa Startup Camp BratislavaGeewa Startup Camp Bratislava
Geewa Startup Camp Bratislava
 
Diferencias entre-conjuntos-formas-tamaño-y-colores
Diferencias entre-conjuntos-formas-tamaño-y-coloresDiferencias entre-conjuntos-formas-tamaño-y-colores
Diferencias entre-conjuntos-formas-tamaño-y-colores
 

Similar to Top schools in ghaziabad

Ch17 OS
Ch17 OSCh17 OS
Ch17 OS
C.U
 
19. Distributed Databases in DBMS
19. Distributed Databases in DBMS19. Distributed Databases in DBMS
19. Distributed Databases in DBMS
koolkampus
 
Distributed databases,types of database
Distributed databases,types of databaseDistributed databases,types of database
Distributed databases,types of database
Boomadevi Shanmugam
 
Distributed databases
Distributed databasesDistributed databases
Distributed databases
sourabhdave
 
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...
DHANUSHKUMARKS
 

Similar to Top schools in ghaziabad (20)

Distributed datababase Transaction and concurrency control
Distributed datababase Transaction and concurrency controlDistributed datababase Transaction and concurrency control
Distributed datababase Transaction and concurrency control
 
Ch17 OS
Ch17 OSCh17 OS
Ch17 OS
 
OS_Ch17
OS_Ch17OS_Ch17
OS_Ch17
 
3 distributed transactions-cocurrency-query
3 distributed transactions-cocurrency-query3 distributed transactions-cocurrency-query
3 distributed transactions-cocurrency-query
 
19. Distributed Databases in DBMS
19. Distributed Databases in DBMS19. Distributed Databases in DBMS
19. Distributed Databases in DBMS
 
Chapter 18 - Distributed Coordination
Chapter 18 - Distributed CoordinationChapter 18 - Distributed Coordination
Chapter 18 - Distributed Coordination
 
DBMS UNIT V.pptx
DBMS UNIT V.pptxDBMS UNIT V.pptx
DBMS UNIT V.pptx
 
Distributed databases,types of database
Distributed databases,types of databaseDistributed databases,types of database
Distributed databases,types of database
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
 
Distributed databases
Distributed databasesDistributed databases
Distributed databases
 
Transaction slide
Transaction slideTransaction slide
Transaction slide
 
transaction management, concept & State
transaction management, concept & Statetransaction management, concept & State
transaction management, concept & State
 
Introduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryIntroduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theory
 
ch14.ppt
ch14.pptch14.ppt
ch14.ppt
 
DBMS Transcations
DBMS TranscationsDBMS Transcations
DBMS Transcations
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013
 
Dos.pptx
Dos.pptxDos.pptx
Dos.pptx
 
Transaction
TransactionTransaction
Transaction
 
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...
 
dos.ppt.pptx
dos.ppt.pptxdos.ppt.pptx
dos.ppt.pptx
 

More from Edhole.com

More from Edhole.com (20)

Ca in patna
Ca in patnaCa in patna
Ca in patna
 
Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarka
 
Ca in dwarka
Ca in dwarkaCa in dwarka
Ca in dwarka
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarka
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in surat
 
Website dsigning company in india
Website dsigning company in indiaWebsite dsigning company in india
Website dsigning company in india
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhi
 
Ca in patna
Ca in patnaCa in patna
Ca in patna
 
Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarka
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarka
 
Ca in dwarka
Ca in dwarkaCa in dwarka
Ca in dwarka
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in surat
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in india
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhi
 
Website designing company in mumbai
Website designing company in mumbaiWebsite designing company in mumbai
Website designing company in mumbai
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website desinging company in surat
Website desinging company in suratWebsite desinging company in surat
Website desinging company in surat
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in india
 

Recently uploaded

Recently uploaded (20)

UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 

Top schools in ghaziabad

  • 1. Top Schools in Ghaziabad By: school.edhole.com
  • 2. Distributed Transactions Transaction may access data at several sites. Each site has a local transaction manager responsible for:  Maintaining a log for recovery purposes  Participating in coordinating the concurrent execution of the transactions executing at that site. Each site has a transaction coordinator, which is responsible for:  Starting the execution of transactions that originate at the site.  Distributing subtransactions at appropriate sites for execution.  Coordinating the termination of each transaction that originates at the site, which may result in the transaction being committed at all sites or aborted at all sites. school.edhole.com Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, ©Silberschatz, Database System Concepts 19.2 Korth and Sudarshan
  • 3. Transaction System Architecture school.edhole.com Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, ©Silberschatz, Database System Concepts 19.3 Korth and Sudarshan
  • 4. System Failure Modes Failures unique to distributed systems:  Failure of a site.  Loss of massages  Handled by network transmission control protocols such as TCP-IP  Failure of a communication link  Handled by network protocols, by routing messages via alternative links  Network partition  A network is said to be partitioned when it has been split into two or more subsystems that lack any connection between them – Note: a subsystem may consist of a single node Network partitioning and site failures are generally indistinguishable. school.edhole.com Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, ©Silberschatz, Database System Concepts 19.4 Korth and Sudarshan
  • 5. Lecture-11 : Commit Protocols Commit protocols are used to ensure atomicity across sites  a transaction which executes at multiple sites must either be committed at all the sites, or aborted at all the sites.  not acceptable to have a transaction committed at one site and aborted at another The two-phase commit (2 PC) protocol is widely used The three-phase commit (3 PC) protocol is more complicated and more expensive, but avoids some drawbacks of two-phase commit protocol. school.edhole.com Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, ©Silberschatz, Database System Concepts 19.5 Korth and Sudarshan
  • 6. Two Phase Commit Protocol (2PC) Assumes fail-stop model – failed sites simply stop working, and do not cause any other harm, such as sending incorrect messages to other sites. Execution of the protocol is initiated by the coordinator after the last step of the transaction has been reached. The protocol involves all the local sites at which the transaction executed Let T be a transaction initiated at site Si, and let the transaction coordinator at Si be Ci school.edhole.com Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, ©Silberschatz, Database System Concepts 19.6 Korth and Sudarshan
  • 7. Phase 1: Obtaining a Decision Coordinator asks all participants to prepare to commit transaction Ti.  Ci adds the records prepare T to the log and forces log to stable storage  sends prepare T messages to all sites at which T executed Upon receiving message, transaction manager at site determines if it can commit the transaction  if not, add a record no T to the log and send abort T message to Ci  if the transaction can be committed, then:  add the record ready T to the log  force all records for T to stable storage  send ready T message to Ci school.edhole.com Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, ©Silberschatz, Database System Concepts 19.7 Korth and Sudarshan
  • 8. Phase 2: Recording the Decision T can be committed of Ci received a ready T message from all the participating sites: otherwise T must be aborted. Coordinator adds a decision record, commit T or abort T, to the log and forces record onto stable storage. Once the record stable storage it is irrevocable (even if failures occur) Coordinator sends a message to each participant informing it of the decision (commit or abort) Participants take appropriate action locally. school.edhole.com Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, ©Silberschatz, Database System Concepts 19.8 Korth and Sudarshan
  • 9. Handling of Failures - Site Failure When site Si recovers, it examines its log to determine the fate of transactions active at the time of the failure. Log contain commit T record: site executes redo (T) Log contains abort T record: site executes undo (T) Log contains ready T record: site must consult Ci to determine the fate of T.  If T committed, redo (T)  If T aborted, undo (T) The log contains no control records concerning T replies that Sk failed before responding to the prepare T message from Ci  since the failure of Sk precludes the sending of such a response C1 must abort T  Sk must execute undo (T) school.edhole.com Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, ©Silberschatz, Database System Concepts 19.9 Korth and Sudarshan
  • 10. Handling of Failures- Coordinator Failure If coordinator fails while the commit protocol for T is executing then participating sites must decide on T’s fate: 1. If an active site contains a commit T record in its log, then T must be committed. 2. If an active site contains an abort T record in its log, then T must be aborted. 3. If some active participating site does not contain a ready T record in its log, then the failed coordinator Ci cannot have decided to commit T. Can therefore abort T. 4. If none of the above cases holds, then all active sites must have a ready T record in their logs, but no additional control records (such as abort T of commit T). In this case active sites must wait for Ci to recover, to find decision. Blocking problem : active sites may have to wait for failed coordinator to recover. school.edhole.com Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, ©Silberschatz, Database System Concepts 19.10 Korth and Sudarshan
  • 11. Handling of Failures - Network Partition If the coordinator and all its participants remain in one partition, the failure has no effect on the commit protocol. If the coordinator and its participants belong to several partitions:  Sites that are not in the partition containing the coordinator think the coordinator has failed, and execute the protocol to deal with failure of the coordinator.  No harm results, but sites may still have to wait for decision from coordinator. The coordinator and the sites are in the same partition as the coordinator think that the sites in the other partition have failed, and follow the usual commit protocol.  Again, no harm results school.edhole.com Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, ©Silberschatz, Database System Concepts 19.11 Korth and Sudarshan
  • 12. Recovery and Concurrency Control In-doubt transactions have a ready T, but neither a commit T, nor an abort T log record. The recovering site must determine the commit-abort status of such transactions by contacting other sites; this can slow and potentially block recovery. Recovery algorithms can note lock information in the log.  Instead of ready T, write out ready T, L L = list of locks held by T when the log is written (read locks can be omitted).  For every in-doubt transaction T, all the locks noted in the ready T, L log record are reacquired. After lock reacquisition, transaction processing can resume; the commit or rollback of in-doubt transactions is performed concurrently with the execution of new transactions. school.edhole.com Database system ,CSE-313, P.B. Dr. M. A. Kashem Asst. Professor. CSE, DUET, ©Silberschatz, Database System Concepts 19.12 Korth and Sudarshan