A Log(n) Multi-Mode Locking Protocol for Distributed Systems

Slides:



Advertisements
Similar presentations
CM20145 Concurrency Control
Advertisements

1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 4: More on Locks Professor Chen Li.
Concurrency Control Amol Deshpande CMSC424. Approach, Assumptions etc.. Approach  Guarantee conflict-serializability by allowing certain types of concurrency.
Managing Hierarchies of Database Elements (18.6) 1 Presented by Sarat Dasika (114) February 16, 2012.
Concurrency Control II. General Overview Relational model - SQL  Formal & commercial query languages Functional Dependencies Normalization Physical Design.
Token-Dased DMX Algorithms n LeLann’s token ring n Suzuki-Kasami’s broadcast n Raymond’s tree.
1 Algorithms and protocols for distributed systems We have defined process groups as having peer or hierarchical structure and have seen that a coordinator.
CS 582 / CMPE 481 Distributed Systems
Managing Hierarchies of Database Elements (18.6) -Neha Saxena Class Id: 214.
Chapter 4 Transaction Management Title: Granularity of Locks and Degrees of Consistency in a Shared Database Authors: J.N. Gray, R.A. Lorie, G. R. Putzolu.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Distributed Snapshots –Termination detection Election algorithms –Bully –Ring.
Concurrency Control Managing Hierarchies of Database Elements (18.6) 1 Presented by Ronak Shah (214) March 9, 2009.
Decentralized resource management for a distributed continuous media server Cyrus Shahabi and Farnoush Banaei-Kashani IEEE Transactions on Parallel and.
Persistent State Service 1 Distributed Object Transactions  Transaction principles  Concurrency control  The two-phase commit protocol  Services for.
CS603 Process Synchronization February 11, Synchronization: Basics Problem: Shared Resources –Generally data –But could be others Approaches: –Model.
Chapter 4 Transaction Management Title: Granularity of Locks and Degrees of Consistency in a Shared Database Authors: J.N. Gray, R.A. Lorie, G. R. Putzolu.
GRANULARITY OF LOCKS IN SHARED DATA BASE J.N. Gray, R.A. Lorie and G.R. Putzolu.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
Database System Architectures  Client-server Database System  Parallel Database System  Distributed Database System Wei Jiang.
15.1Database System Concepts - 6 th Edition Chapter 15: Concurrency Control Lock-Based Protocols The Two-Phase Locking Protocol Graph-Based Protocols #Deadlock.
Concurrency Control.
Distributed Shared Memory: A Survey of Issues and Algorithms B,. Nitzberg and V. Lo University of Oregon.
1 A Mutual Exclusion Algorithm for Ad Hoc Mobile networks Presentation by Sanjeev Verma For COEN th Nov, 2003 J. E. Walter, J. L. Welch and N. Vaidya.
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 10: Concurrency Control Dr. Michael R. Lyu Computer Science & Engineering.
4.5 DISTRIBUTED MUTUAL EXCLUSION MOSES RENTAPALLI.
CS 5204 (FALL 2005)1 Leases: An Efficient Fault Tolerant Mechanism for Distributed File Cache Consistency Gray and Cheriton By Farid Merchant Date: 9/21/05.
CS551 - Lecture 18 1 CS551 Object Oriented Middleware (VII) Advanced Topics (Chap of EDO) Yugi Lee STB #555 (816)
MUTUAL EXCLUSION AND QUORUMS CS Distributed Mutual Exclusion Given a set of processes and a single resource, develop a protocol to ensure exclusive.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms –Bully algorithm.
Locating Mobile Agents in Distributed Computing Environment.
V. Megalooikonomou Concurrency control (based on slides by C. Faloutsos at CMU and on notes by Silberchatz,Korth, and Sudarshan) Temple University – CIS.
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 6: Concurrency Control Dr. Michael R. Lyu Computer Science & Engineering.
Presenter: Long Ma Advisor: Dr. Zhang 4.5 DISTRIBUTED MUTUAL EXCLUSION.
Transactions and Concurrency Control. Concurrent Accesses to an Object Multiple threads Atomic operations Thread communication Fairness.
DEADLOCK DETECTION ALGORITHMS IN DISTRIBUTED SYSTEMS
Page 1 Mutual Exclusion & Election Algorithms Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content.
Distributed DBMS, Query Processing and Optimization
Lecture 9- Concurrency Control (continued) Advanced Databases Masood Niazi Torshiz Islamic Azad University- Mashhad Branch
GPFS: A Shared-Disk File System for Large Computing Clusters Frank Schmuck & Roger Haskin IBM Almaden Research Center.
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Prepared by: Mudra Patel (113) Pradhyuman Raol(114) Locking Scheduler & Managing Hierarchies of Database Elements.
Section 18.6: Managing Hierarchies of Database Elements
Concurrency Control Managing Hierarchies of Database Elements (18.6)
Chapter 17: Database System Architectures
Chapter 17: Database System Architectures
Chapter 20: Database System Architectures
Lecture on Database System Architectures
Chapter 2: Database System Architectures
Concurrency Control Techniques
Chapter 17: Database System Architectures
Chapter 16: Concurrency Control
J.N GRAY R.A LORIE IBM RESEARCH LAB, SAN JOSE, CALIFORNIA
Outline Distributed Mutual Exclusion Distributed Deadlock Detection
CS5102 High Performance Computer Systems Distributed Shared Memory
Chapter 17: Database System Architectures
Distributed Mutual Exclusion
Ch 22: Databases Concurrency Control
Yiannis Nikolakopoulos
CS 213 Lecture 11: Multiprocessor 3: Directory Organization
Chapter 20: Database System Architectures
Chapter 18: Database System Architectures
Chapter 17: Database System Architectures
Concurrency Control E0 261 Prasad Deshpande, Jayant Haritsa
Temple University – CIS Dept. CIS661 – Principles of Data Management
Chapter 18: Database System Architectures
Chapter 20: Database System Architectures
Chapter 18: Database System Architectures
Database System Architectures
CONCURRENCY Concurrency is the tendency for different tasks to happen at the same time in a system ( mostly interacting with each other ) .   Parallel.
Prepared by: Mudra Patel (113) Pradhyuman Raol(114)
Presentation transcript:

A Log(n) Multi-Mode Locking Protocol for Distributed Systems Nirmit Desai, Frank Mueller mueller@cs.ncsu.edu Department of Computer Science North Carolina State University

Background Problem Motivation Approach Contribution Large parallel and distributed systems Scalability of synchronization Motivation Increasing need to share resources Inadequate scalability of current protocols Approach Leveraging hierarchical locking in distributed synchronization Contribution Highly scalable protocol Supports hierarchical locking May 6, 2019 NC State University

Large Distributed Environments Cluster Environments Shared Resource 1 Shared Resource 2 Site 1 Site 2 Site 3 Network Site N May 6, 2019 NC State University

Distributed Synchronization (Naimi et al.) Request from A Request from C T is done Single locking mode - Read and Write are not distinguished Single level of locking granularity (either entire table or a tuple) May 6, 2019 NC State University

Hierarchical Locking (a.k.a. Multi-granularity Locking) How is a lock associated with data items ? Data Fine grain Data Coarse grain Data Multi grain - High overhead - High concurreny - Low overhead - No concurrency - Low overhead - High concurrency May 6, 2019 NC State University

Multi-Mode Locking Protocol 1. Intention Read (IR) /Intention Write (IW) on all upper level resources 2. Read (R) locks and Write (W) locks on the resource itself A : Reads tuple 2 t0:Acquire IR on the table t1:Acquire R on tuple #2 t2:Read tuple #2 t3:Release R t4:Release IR Data table B : Writes tuple 3 t0:Acquire IW on the table t1:Acquire W on tuple #3 t2:Write tuple #3 t3:Release W t4:Release IW May 6, 2019 NC State University

Multi-Mode Locking Protocol (cont.) Modes incompatible?  Conflict  Block A: reads entire table t0:Acquire R on the table t1:Read table t2:Release R on the table Data table B : Writes a tuple t0:Request IW on the table t1: wait for lock t2:Acquires IW t3:Acquire W on tuple t4:... X May 6, 2019 NC State University

IR < R < U = IW < W Compatibility Matrix ‘X’ indicates a conflict Upgrade: Read followed by write to same data assures consistent data Lock Mode Strength: Less compatible  Stronger lock mode IR < R < U = IW < W May 6, 2019 NC State University

Our Protocol - Conventions Held Mode: Mh = Mode of held lock Owned Mode: Mo = Strongest held mode in tree (rooted=owner) Pending Mode: Mp = await this mode Node state: (Mo, Mh, Mp) Request arrives  test compatibility  grant/queue/forward based on result Actions: rules & transition tables Requester becomes a child of granter A(0,0,0) C(IR,IR,0) D(IR,IR,0) B(R,R,0) E(U,U,0) May 6, 2019 NC State University

A Granting/Forwarding Example Invariant : “Node cannot grant request for stronger mode than it owns”  has to forward it to parent A(0,0,0) C(0,0,0) D(0,0,IR) B(0,0,0) E(IR,IR,0) A(0,0,R) C(0,0,0) D(IR,IR,0) B(0,0,0) E(IR,IR,0) A(R,R,0) C(0,0,0) D(IR,IR,0) B(0,0,0) E(IR,IR,0) A requests R Token transfer (D,IR) (A,R) Grant (A,R) If Mr compatible with Mo  Mr compatible w/ all modes in subtree May 6, 2019 NC State University

A Release Example Invariant: “Node knows owned mode of its children” C(IR,IR,0) D(IR,IR,0) B(IR,IR,0) E(R,R,0) A(0,0,0) C(IR,IR,0) D(IR,IR,0) B(IR,0,0) E(R,R,0) B(IR,0,0) A(0,0,0) C(0,0,0) D(IR,IR,0) E(R,R,0) B releases IR C releases IR (B,IR) B(0,0,0) (C,IR) Notice: If a child releases a mode but owned mode is unchanged, no need to notify our parent May 6, 2019 NC State University

A Queuing Example Invariants: “Queue if request is conflicting. Freeze modes if it is a) incompatible with queued request and b) grantable otherwise” A(0,0,IR) C(0,0,W) D(R,R,0) B(IR,IR,0) E(R,R,0) IR IR, R (C,W) IR, R, U A(0,0,0) C(0,0,W) D(R,R,0) B(IR,IR,0) E(R,R,0) IR, R, U A(0,0,0) C(0,0,W) D(R,R,0) B(IR,IR,0) E(R,R,0) (C,W) IR, R, U Send freeze A requests IR (C,W) (C,W)(A,IR) Freeze (IR) (IR, R) (C,W) (A,IR) IR IR, R (C,W) (A,IR) Starvation of queued request is avoided, FIFO is ensured May 6, 2019 NC State University

Measurements Metrics of interest: Scalability of Message overhead per lock request Request latency time Effect of changing concurrency level on scalability higher ratio  lower concurency Compare with Naimi’s protocol Coarse: Lock the entire table Fine: Lock each entry Multi-airline reservation system IBM SP Power3 May 6, 2019 NC State University

Comparison with Naimi’s protocols Message overhead per Request Response time per Request Naimi coarse has different functionality May 6, 2019 NC State University

Effect of concurrency level Concurrency level increases as # of nodes increase May 6, 2019 NC State University

Applications State management of replicated data Distributed databases (Oracle, MS-SQL) Distributed transaction processing Middleware concurrency services (CORBA) Coordinated, distributed Server Farms Fault tolerance in clusters State replication for redundant computing Distributed agreement State coherence May 6, 2019 NC State University

Related Work Naimi et. al. (JPDC ‘96) Ramamritham et. Al. (SIGMOD ‘90) Distributed mutual exclusion, single level of granularity Ramamritham et. Al. (SIGMOD ‘90) Concurrency protocols, centralized transaction coordinator Other approaches: complexity > O(log (n)) Hierarchical locking: only in context of distributed synchronization problems in past Scalability: had not been the focus May 6, 2019 NC State University

Conclusions Novel peer-to-peer distributed concurrency protocol Compact formulation: rules and tables  simplicity intriguing Highly scalable: O(log n) msgs, asymptote 3-5 msgs High degree of concurrency common Scalability unaffected by concurrency level Response time: linear increasing w/ concurrency level Best scalable protocol for hierarchical locking known Wide applications in parallel and distributed world May 6, 2019 NC State University

Breakup of Messages Request propagation is major component C May 6, 2019 NC State University

Request Message Concurrency level Request forwarding Request Nodes Tree height Path length Request more request msgs propagation paths longer May 6, 2019 NC State University

Token Message Concurrency level Granting Token transfers Nodes Tree height Granting Token transfers more contention lower chance to grant token May 6, 2019 NC State University

Grant Message Concurrency level Granting Nodes Tree height Granting more contention more child grants May 6, 2019 NC State University

Release Message Concurrency level Granting Release Nodes Tree height Granting Release higher concurrency more trees & release msgs May 6, 2019 NC State University

Freeze Message Concurrency level Conflicts Freeze Nodes Requests Conflicts Freeze higher concurrency more freezes (be fair) May 6, 2019 NC State University

Rule for Granting at Non-root X = cannot grant May 6, 2019 NC State University

Rule for Queuing/Forwarding Queue May 6, 2019 NC State University

Rule for Freezing Modes Modes to freeze May 6, 2019 NC State University