SlideShare a Scribd company logo
1 of 25
Download to read offline
Deadlock Prevention Mechanism
for Distributed Transaction
Management
By: Nileshwari Desai
Roll No: A 216
Contents
• Introduction
• Background
• Proposed design
• Improvement
• Related work
• Conclusion
• Future work
• References
Introduction
• Massive increase in business services requirements have
necessitated the use of distributed transactions. Many
enterprises use SOA as their basic business architecture, such
as stock deal, bank services and on-line ticket booking system.
• With the success of SOA, many large-scale information
systems have been set up to process the business transaction
services simultaneously, especially in grid environments.
• Grid transaction principles were brought forward to build
dynamic, distributed and scalable data access and
management for e-business applications.
• In fact, many current distributed applications integrate
heterogeneous databases in one system by using JTA and the
like technologies to provide distributed or cloud services.
With grid transaction involved, new services on different
stations can be easily integrated into existing applications.
Proposal by the author
• Providing efficient replica mechanism to support for
locking services of preventing inner deadlock in local
transactions.
• Designing a timestamps based victim selection
criteria that can break a deadlock cycle when global
deadlock is detected.
• Designing an intelligent resource manager to detect
inner transactions collisions or global transaction
deadlock and allocate appropriate locks for each
transaction.
Background
Deadlock
Local deadlock
Global
deadlock
Distributed
transaction
coordination
algorithm
Flow/ Phases
A). Distributed Transaction
Coordination Algorithm
• Most commercially available transaction services
support only a flat distributed transaction model. This is
a top-level transaction and has the fundamental property
of a transaction: atomicity, consistency, isolation and
durability. Usually, an atomic transaction is managed by
a transaction manager(TM) with a resource manager
(RM) which is responsible for allocating resources. A RM
can be shared by many TMs to cooperate in distributed
environment.
• For distributed transactions, we should expand the scope
to join several resource managers and need to control all
the resources involved in a nested transaction.
Phases
• First phase: all participants (sub-transaction) receive instruction
from the transaction coordinator to prepare to commit. If a given
resource manager can commit its work, it votes agree to the
coordinator saying that it's prepared. If this resource manager
cannot commit, it replies that it is unable to commit and rolls back
its work.
• Second phase: the transaction manager sends a commit
acknowledgment to all participants if all of them reach prepared
state. Otherwise it tells all of them to roll back. Then all the resource
managers commit or roll back as directed and return status to the
transaction manager.
This simplified two-phase commit protocol flow ensures that every
participant in one execution takes the same action (everybody
commits or everybody rolls back), so the resource updates are either
committed together or rolled back together.
B). Deadlock Scenarios
• In distributed especially grid environment,
commercial transaction services are often deployed
on different sites. Each transaction, whatever local
or global, may access many different resources at the
same time. In this paper, the author calls local
transactions for only one big nested transaction with
many sub-transactions.
• In contrast, several local transactions, each
supposed to be independent, are called global
transactions.
Local deadlock
• To support a two -phase commit transaction, the resource managers
must hold the requested resources between phase one and phase
two, otherwise other applications may grant access to these
resources and lead to inconsistency if they update the resources at
the same time. Resource manager often takes lock to hold the
resources for the request from some transaction manager until the
second phase receiving instructions to commit or roll back, and then
release its lock.
• After the first stage, the transaction coordinator waits for all the
sub-transactions (participants) to vote their approval (prepared or
not). It must collect all of their opinions to make the final decision.
Under this condition, if two or more participants request for the
same resources, a guaranteed deadlock is inevitable.
Simple dead lock
Global deadlock
Extended local deadlock
THE PROPOSED DESIGN
• how to prevent deadlock for local transactions.
• deadlock prevention and victim selection
mechanisms for global transactions
A). Replica Based Local Deadlock
Prevention
• The basic idea is to produce a replication of the resource
when more than one participants request it. So we need
an intelligent resource manager which is responsible for
allocating resources for every applicant.
• Every transaction has a unique transaction id, including
sub-transactions. When a sub-transaction manager
receives instruction from parent transaction
manager/coordinator, it keeps the root transaction id
passed by its parent and produces its own sub-id. So
every participant knows the root id and we can
distinguish if two sub-transactions belong to the same
nested transaction. If two participants have the same
root id, we don't care which level they are on.
Replica based mechanism for
guaranteed deadlock
B). Timestamps Based Restart Policy
for Global Deadlock Prevention
• Standard technology of deadlock avoidance
expects sequentially resource access. For some
resources, system could declare the most
amount of requirements in advance. This is a
pessimistic static allocation algorithm that needs
to exploit prior knowledge of transaction access
patterns. If deadlock is allowed (e.g. it's rare to
happen), detection and resolution are the main
issues we should consider.
Global deadlock resolution
The deadlock prevention steps:
Step 1. Transaction manager receives user's task and produces a global
unique root transaction id. This id can be a function of current time to
distinguish which transaction starts earlier. TM divides the task into sub-
transactions and distributes them onto different sites which host specified
transaction service.
Step 2. Each participant receives pre-check instruction and begins to try to
get all the needed resources from resource manager.
Step 3. If the coordinator receives positive checked messages from all
participants, it decides to send a request-to-prepare message to each of them,
and the two-phase commit begins. Otherwise, it should be regarded as not
meeting its prerequisite to continue.
Live lock
C). Improvement
• Though a pre-check phase can be added to the two-phase commit
protocol, especially for long transactions which do not need to waste
too long for prepared sub-transactions if some of them fail at pre-
check phase, we could optimize it for some real-time or basic atomic
transactions. The base idea is to piggy back this phase onto the
prepare phase to reduce communication overhead.
• For every participants, if it cannot obtain the lock of required
resources, it will response not prepared message to the coordinator
directly. On the other hand, the participants start to prepare their
work of transaction execution, though they may be disrupted at any
time. For they are not committed, aborting themselves at any time
has no effect on the resources. But this will cause another a little
change that resource manager may need to wait until other
transaction aborts if resource request conflict happens.
Related work
• Several researchers have proposed centralized and distributed
deadlock detection algorithm. Others outlined the key differences
between the local deadlock detection utilizing external detector
node and distributed deadlock detection by transmitting deadlock
information from one site to another. In the current design the
author leverage the benefits of resource manager for distributed
transaction to control concurrently resource access to avoid
deadlocks. It is particularly useful for independent business services
which have prior knowledge of what resources they will access.
• Yi-Min Wang et. al. , have proposed guaranteed deadlock recovery
based on run-time dependency graph and incorporated it into
distributed deadlock detection algorithm, their design can only
support message-passing applications. In the proposed work the
author provides efficient prevention mechanism with precious a
little of overhead for different types of transaction.
Conclusion
• The massive increase in SaaS based business service model
requirements has necessitated the use of highly efficient distributed
transaction processing. In this paper, the author has presented a
novel distributed deadlock prevention mechanism utilizing the prior
knowledge of required resources by extending standard two-phase
commit protocol.
• The approach solves the guaranteed deadlock perfectly for local
nested transactions.
• Further, it is also demonstrated that the approach used in
distributed transaction services is totally free of deadlock and there
isn't any more overhead after a little optimization is applied. Since
the design highly depends on the resource manager to distinguish
different resource requests, it should be much strong to
communicate with transaction managers and needs to keep massive
resource status under highly concurrent condition.
Future work
• One can plan to extend the designs to include more
precisely control of different types of locks, such as
shared locks and exclusive locks. Shared locks
should deserve special treatment by resource
manager but need more consistency consideration.
• In addition, transaction recovery is not discussed in
this paper though it may cause other potential
deadlocks. Three-phase commit protocol is an
example that one can probe deeply into about its
traditional locking mechanisms.
References
[1]. Xinfeng Ye, John A. Keane, “A distributed transaction
management scheme for multi database”, University of
Auckland.
[2]. Lin Lou, Feilong Tang, Ilsun You, Minyi Guo, Yao Sen,
“An effective deadlock prevention mechansim for
distributed transaction management”, Korean bible
university, Hong kong.
[3]. David Taniar, “high performance parallel database
processing and grid databases”
deadlock prevention

More Related Content

What's hot

deadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURYdeadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURYअनिकेत चौधरी
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed SystemsPritom Saha Akash
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbiansaad symbian
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating systemSara Ali
 
Deadlock and memory management -- Operating System
Deadlock and memory management -- Operating SystemDeadlock and memory management -- Operating System
Deadlock and memory management -- Operating SystemEktaVaswani2
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactionsNilu Desai
 
A survey of distributed deadlock detection algorithms
A survey of distributed deadlock detection algorithmsA survey of distributed deadlock detection algorithms
A survey of distributed deadlock detection algorithmsanaykh1992
 
Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systemsmridul mishra
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating SystemAUST
 

What's hot (20)

deadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURYdeadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
 
Deadlocks2
Deadlocks2Deadlocks2
Deadlocks2
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
 
Chapter06
Chapter06Chapter06
Chapter06
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbian
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
Deadlock and memory management -- Operating System
Deadlock and memory management -- Operating SystemDeadlock and memory management -- Operating System
Deadlock and memory management -- Operating System
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactions
 
A survey of distributed deadlock detection algorithms
A survey of distributed deadlock detection algorithmsA survey of distributed deadlock detection algorithms
A survey of distributed deadlock detection algorithms
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
OS - Deadlock
OS - DeadlockOS - Deadlock
OS - Deadlock
 
Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systems
 
Deadlocks1
Deadlocks1Deadlocks1
Deadlocks1
 
Deadlock dbms
Deadlock dbmsDeadlock dbms
Deadlock dbms
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating System
 
Operating system - Deadlock
Operating system - DeadlockOperating system - Deadlock
Operating system - Deadlock
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Sucet os module_3_notes
Sucet os module_3_notesSucet os module_3_notes
Sucet os module_3_notes
 

Similar to deadlock prevention

Saga transactions msa_ architecture
Saga transactions msa_ architectureSaga transactions msa_ architecture
Saga transactions msa_ architectureMauro Vocale
 
Management of Distributed Transactions
Management of Distributed TransactionsManagement of Distributed Transactions
Management of Distributed TransactionsAnkita Dubey
 
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...JSFestUA
 
Ripple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout WhitepaperRipple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout WhitepaperTrung Vu
 
Article by Marlabs Bangalore employee receives international recognition!
Article by Marlabs Bangalore employee receives international recognition!Article by Marlabs Bangalore employee receives international recognition!
Article by Marlabs Bangalore employee receives international recognition!Marlabs
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumRick Hightower
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.pptBikalAdhikari4
 
Fault Tolerant and Distributed System
Fault Tolerant and Distributed SystemFault Tolerant and Distributed System
Fault Tolerant and Distributed Systemsreenivas1591
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsSachin Chauhan
 
Vilnius blockchain club 20170413 consensus
Vilnius blockchain club 20170413 consensusVilnius blockchain club 20170413 consensus
Vilnius blockchain club 20170413 consensusAudrius Ramoska
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Rick Hightower
 
Deployability
DeployabilityDeployability
DeployabilityLen Bass
 
Programmable Money and Business Process Management on Blockchain
Programmable Money and Business Process Management on BlockchainProgrammable Money and Business Process Management on Blockchain
Programmable Money and Business Process Management on BlockchainIngo Weber
 
Iata blockchain presentation icaew suisse branch
Iata blockchain presentation   icaew suisse branchIata blockchain presentation   icaew suisse branch
Iata blockchain presentation icaew suisse branchTim Moss
 
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
Manage the Digital Transformation with Machine Learning in a Reactive Microse...Manage the Digital Transformation with Machine Learning in a Reactive Microse...
Manage the Digital Transformation with Machine Learning in a Reactive Microse...DataWorks Summit
 
Enterprise Broadband Business Appications
Enterprise Broadband Business AppicationsEnterprise Broadband Business Appications
Enterprise Broadband Business AppicationsInfosys
 
Distributed datababase Transaction and concurrency control
Distributed datababase Transaction and concurrency controlDistributed datababase Transaction and concurrency control
Distributed datababase Transaction and concurrency controlbalamurugan.k Kalibalamurugan
 
OpenStack Quota Management Study Report
OpenStack Quota Management Study ReportOpenStack Quota Management Study Report
OpenStack Quota Management Study ReportJu Lim
 

Similar to deadlock prevention (20)

Saga transactions msa_ architecture
Saga transactions msa_ architectureSaga transactions msa_ architecture
Saga transactions msa_ architecture
 
Management of Distributed Transactions
Management of Distributed TransactionsManagement of Distributed Transactions
Management of Distributed Transactions
 
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
 
Ripple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout WhitepaperRipple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout Whitepaper
 
Article by Marlabs Bangalore employee receives international recognition!
Article by Marlabs Bangalore employee receives international recognition!Article by Marlabs Bangalore employee receives international recognition!
Article by Marlabs Bangalore employee receives international recognition!
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO Forum
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
 
Fault Tolerant and Distributed System
Fault Tolerant and Distributed SystemFault Tolerant and Distributed System
Fault Tolerant and Distributed System
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit Protocols
 
Vilnius blockchain club 20170413 consensus
Vilnius blockchain club 20170413 consensusVilnius blockchain club 20170413 consensus
Vilnius blockchain club 20170413 consensus
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)
 
Deployability
DeployabilityDeployability
Deployability
 
Programmable Money and Business Process Management on Blockchain
Programmable Money and Business Process Management on BlockchainProgrammable Money and Business Process Management on Blockchain
Programmable Money and Business Process Management on Blockchain
 
Iata blockchain presentation icaew suisse branch
Iata blockchain presentation   icaew suisse branchIata blockchain presentation   icaew suisse branch
Iata blockchain presentation icaew suisse branch
 
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
Manage the Digital Transformation with Machine Learning in a Reactive Microse...Manage the Digital Transformation with Machine Learning in a Reactive Microse...
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
 
Enterprise Broadband Business Appications
Enterprise Broadband Business AppicationsEnterprise Broadband Business Appications
Enterprise Broadband Business Appications
 
Distributed datababase Transaction and concurrency control
Distributed datababase Transaction and concurrency controlDistributed datababase Transaction and concurrency control
Distributed datababase Transaction and concurrency control
 
OpenStack Quota Management Study Report
OpenStack Quota Management Study ReportOpenStack Quota Management Study Report
OpenStack Quota Management Study Report
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
 

More from Nilu Desai

data mining for terror attacks
data mining for terror attacksdata mining for terror attacks
data mining for terror attacksNilu Desai
 
Adversarial search
Adversarial searchAdversarial search
Adversarial searchNilu Desai
 
collaborative study on the cloud
collaborative study on the cloudcollaborative study on the cloud
collaborative study on the cloudNilu Desai
 
digital signature for SMS security
digital signature for SMS securitydigital signature for SMS security
digital signature for SMS securityNilu Desai
 
Cookie replay attack unit wise presentation
Cookie replay attack  unit wise presentationCookie replay attack  unit wise presentation
Cookie replay attack unit wise presentationNilu Desai
 
Iris recognition system
Iris recognition systemIris recognition system
Iris recognition systemNilu Desai
 

More from Nilu Desai (6)

data mining for terror attacks
data mining for terror attacksdata mining for terror attacks
data mining for terror attacks
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
collaborative study on the cloud
collaborative study on the cloudcollaborative study on the cloud
collaborative study on the cloud
 
digital signature for SMS security
digital signature for SMS securitydigital signature for SMS security
digital signature for SMS security
 
Cookie replay attack unit wise presentation
Cookie replay attack  unit wise presentationCookie replay attack  unit wise presentation
Cookie replay attack unit wise presentation
 
Iris recognition system
Iris recognition systemIris recognition system
Iris recognition system
 

Recently uploaded

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Recently uploaded (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

deadlock prevention

  • 1. Deadlock Prevention Mechanism for Distributed Transaction Management By: Nileshwari Desai Roll No: A 216
  • 2. Contents • Introduction • Background • Proposed design • Improvement • Related work • Conclusion • Future work • References
  • 3. Introduction • Massive increase in business services requirements have necessitated the use of distributed transactions. Many enterprises use SOA as their basic business architecture, such as stock deal, bank services and on-line ticket booking system. • With the success of SOA, many large-scale information systems have been set up to process the business transaction services simultaneously, especially in grid environments. • Grid transaction principles were brought forward to build dynamic, distributed and scalable data access and management for e-business applications. • In fact, many current distributed applications integrate heterogeneous databases in one system by using JTA and the like technologies to provide distributed or cloud services. With grid transaction involved, new services on different stations can be easily integrated into existing applications.
  • 4. Proposal by the author • Providing efficient replica mechanism to support for locking services of preventing inner deadlock in local transactions. • Designing a timestamps based victim selection criteria that can break a deadlock cycle when global deadlock is detected. • Designing an intelligent resource manager to detect inner transactions collisions or global transaction deadlock and allocate appropriate locks for each transaction.
  • 6. A). Distributed Transaction Coordination Algorithm • Most commercially available transaction services support only a flat distributed transaction model. This is a top-level transaction and has the fundamental property of a transaction: atomicity, consistency, isolation and durability. Usually, an atomic transaction is managed by a transaction manager(TM) with a resource manager (RM) which is responsible for allocating resources. A RM can be shared by many TMs to cooperate in distributed environment. • For distributed transactions, we should expand the scope to join several resource managers and need to control all the resources involved in a nested transaction.
  • 7. Phases • First phase: all participants (sub-transaction) receive instruction from the transaction coordinator to prepare to commit. If a given resource manager can commit its work, it votes agree to the coordinator saying that it's prepared. If this resource manager cannot commit, it replies that it is unable to commit and rolls back its work. • Second phase: the transaction manager sends a commit acknowledgment to all participants if all of them reach prepared state. Otherwise it tells all of them to roll back. Then all the resource managers commit or roll back as directed and return status to the transaction manager. This simplified two-phase commit protocol flow ensures that every participant in one execution takes the same action (everybody commits or everybody rolls back), so the resource updates are either committed together or rolled back together.
  • 8. B). Deadlock Scenarios • In distributed especially grid environment, commercial transaction services are often deployed on different sites. Each transaction, whatever local or global, may access many different resources at the same time. In this paper, the author calls local transactions for only one big nested transaction with many sub-transactions. • In contrast, several local transactions, each supposed to be independent, are called global transactions.
  • 9. Local deadlock • To support a two -phase commit transaction, the resource managers must hold the requested resources between phase one and phase two, otherwise other applications may grant access to these resources and lead to inconsistency if they update the resources at the same time. Resource manager often takes lock to hold the resources for the request from some transaction manager until the second phase receiving instructions to commit or roll back, and then release its lock. • After the first stage, the transaction coordinator waits for all the sub-transactions (participants) to vote their approval (prepared or not). It must collect all of their opinions to make the final decision. Under this condition, if two or more participants request for the same resources, a guaranteed deadlock is inevitable.
  • 13. THE PROPOSED DESIGN • how to prevent deadlock for local transactions. • deadlock prevention and victim selection mechanisms for global transactions
  • 14. A). Replica Based Local Deadlock Prevention • The basic idea is to produce a replication of the resource when more than one participants request it. So we need an intelligent resource manager which is responsible for allocating resources for every applicant. • Every transaction has a unique transaction id, including sub-transactions. When a sub-transaction manager receives instruction from parent transaction manager/coordinator, it keeps the root transaction id passed by its parent and produces its own sub-id. So every participant knows the root id and we can distinguish if two sub-transactions belong to the same nested transaction. If two participants have the same root id, we don't care which level they are on.
  • 15. Replica based mechanism for guaranteed deadlock
  • 16. B). Timestamps Based Restart Policy for Global Deadlock Prevention • Standard technology of deadlock avoidance expects sequentially resource access. For some resources, system could declare the most amount of requirements in advance. This is a pessimistic static allocation algorithm that needs to exploit prior knowledge of transaction access patterns. If deadlock is allowed (e.g. it's rare to happen), detection and resolution are the main issues we should consider.
  • 18. The deadlock prevention steps: Step 1. Transaction manager receives user's task and produces a global unique root transaction id. This id can be a function of current time to distinguish which transaction starts earlier. TM divides the task into sub- transactions and distributes them onto different sites which host specified transaction service. Step 2. Each participant receives pre-check instruction and begins to try to get all the needed resources from resource manager. Step 3. If the coordinator receives positive checked messages from all participants, it decides to send a request-to-prepare message to each of them, and the two-phase commit begins. Otherwise, it should be regarded as not meeting its prerequisite to continue.
  • 20. C). Improvement • Though a pre-check phase can be added to the two-phase commit protocol, especially for long transactions which do not need to waste too long for prepared sub-transactions if some of them fail at pre- check phase, we could optimize it for some real-time or basic atomic transactions. The base idea is to piggy back this phase onto the prepare phase to reduce communication overhead. • For every participants, if it cannot obtain the lock of required resources, it will response not prepared message to the coordinator directly. On the other hand, the participants start to prepare their work of transaction execution, though they may be disrupted at any time. For they are not committed, aborting themselves at any time has no effect on the resources. But this will cause another a little change that resource manager may need to wait until other transaction aborts if resource request conflict happens.
  • 21. Related work • Several researchers have proposed centralized and distributed deadlock detection algorithm. Others outlined the key differences between the local deadlock detection utilizing external detector node and distributed deadlock detection by transmitting deadlock information from one site to another. In the current design the author leverage the benefits of resource manager for distributed transaction to control concurrently resource access to avoid deadlocks. It is particularly useful for independent business services which have prior knowledge of what resources they will access. • Yi-Min Wang et. al. , have proposed guaranteed deadlock recovery based on run-time dependency graph and incorporated it into distributed deadlock detection algorithm, their design can only support message-passing applications. In the proposed work the author provides efficient prevention mechanism with precious a little of overhead for different types of transaction.
  • 22. Conclusion • The massive increase in SaaS based business service model requirements has necessitated the use of highly efficient distributed transaction processing. In this paper, the author has presented a novel distributed deadlock prevention mechanism utilizing the prior knowledge of required resources by extending standard two-phase commit protocol. • The approach solves the guaranteed deadlock perfectly for local nested transactions. • Further, it is also demonstrated that the approach used in distributed transaction services is totally free of deadlock and there isn't any more overhead after a little optimization is applied. Since the design highly depends on the resource manager to distinguish different resource requests, it should be much strong to communicate with transaction managers and needs to keep massive resource status under highly concurrent condition.
  • 23. Future work • One can plan to extend the designs to include more precisely control of different types of locks, such as shared locks and exclusive locks. Shared locks should deserve special treatment by resource manager but need more consistency consideration. • In addition, transaction recovery is not discussed in this paper though it may cause other potential deadlocks. Three-phase commit protocol is an example that one can probe deeply into about its traditional locking mechanisms.
  • 24. References [1]. Xinfeng Ye, John A. Keane, “A distributed transaction management scheme for multi database”, University of Auckland. [2]. Lin Lou, Feilong Tang, Ilsun You, Minyi Guo, Yao Sen, “An effective deadlock prevention mechansim for distributed transaction management”, Korean bible university, Hong kong. [3]. David Taniar, “high performance parallel database processing and grid databases”