Synchronization Chapter 5. Clock Synchronization When each machine has its own clock, an event that occurred after another event may nevertheless be assigned.

Презентация:



Advertisements
Похожие презентации
HPC Pipelining Parallelism is achieved by starting to execute one instruction before the previous one is finished. The simplest kind overlaps the execution.
Advertisements

Consistency and Replication Chapter 6. Object Replication (1) Organization of a distributed remote object shared by two different clients.
© 2009 Avaya Inc. All rights reserved.1 Chapter Nine, Voic Pro in SCN Module Four – Distributed Voic Pro.
Fault Tolerance Chapter 7. Basic Concepts Dependability Includes Availability Reliability Safety Maintainability.
Copyright 2003 CCNA 1 Chapter 9 TCP/IP Transport and Application Layers By Your Name.
© 2006 Cisco Systems, Inc. All rights reserved. BSCI v Configuring EIGRP Using EIGRP in an Enterprise Network.
Lecture # Computer Architecture Computer Architecture = ISA + MO ISA stands for instruction set architecture is a logical view of computer system.
© 2009 Avaya Inc. All rights reserved.1 Chapter Nine, Voic Pro in SCN Module Three – Backup Voic Pro.
GET CONNECTED Move Ahead 7 th form VOCABULARY WORK Lets refresh the words. Read the questions and use the new words in your answers.
© 2009 Avaya Inc. All rights reserved.1 Chapter Seven, Customer Call Reporter (CCR) Module Two – Standard Configuration.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Customer-to-Provider Connectivity with BGP Connecting a Multihomed Customer to Multiple Service.
Unit 2 Users Management. Users Every user is assigned a unique User ID number (UID) UID 0 identifies root User accounts normally start at UID 500 Users'
Windows Server 2003 DHCP How DHCP Allocates IP Addresses DHCP Server DHCP Database IP Address1: Leased to DHCP Client1 IP Address2:
© 2005 Cisco Systems, Inc. All rights reserved. INTRO v Growing the Network Maximizing the Benefits of Switching.
© 2005 Cisco Systems, Inc. All rights reserved.INTRO v Operating and Configuring Cisco IOS Devices Configuring a Router.
Week Finding and Processing files 2 locate Queries a pre-built database of paths to files on the system Database must be updated by administrator.
Benford Benford's law, also called the first-digit law, states that in lists of numbers from many (but not all) real-life sources of data, the leading.
© 2006 Cisco Systems, Inc. All rights reserved. BSCI v Configuring EIGRP Introducing EIGRP.
© 2006 Cisco Systems, Inc. All rights reserved. BSCI v Implementing BGP Explaining BGP Concepts and Terminology.
© 2006 Cisco Systems, Inc. All rights reserved. BSCI v Configuring OSPF Introducing the OSPF Protocol.
Транксрипт:

Synchronization Chapter 5

Clock Synchronization When each machine has its own clock, an event that occurred after another event may nevertheless be assigned an earlier time.

Physical Clocks (1) Computation of the mean solar day.

Physical Clocks (2) TAI seconds are of constant length, unlike solar seconds. Leap seconds are introduced when necessary to keep in phase with the sun.

Clock Synchronization Algorithms The relation between clock time and UTC when clocks tick at different rates.

Cristian's Algorithm Getting the current time from a time server.

The Berkeley Algorithm a)The time daemon asks all the other machines for their clock values b)The machines answer c)The time daemon tells everyone how to adjust their clock

Lamport Timestamps a)Three processes, each with its own clock. The clocks run at different rates. b)Lamport's algorithm corrects the clocks.

Example: Totally-Ordered Multicasting Updating a replicated database and leaving it in an inconsistent state.

Global State (1) a)A consistent cut b)An inconsistent cut

Global State (2) a)Organization of a process and channels for a distributed snapshot

Global State (3) b)Process Q receives a marker for the first time and records its local state c)Q records all incoming message d)Q receives a marker for its incoming channel and finishes recording the state of the incoming channel

The Bully Algorithm (1) The bully election algorithm Process 4 holds an election Process 5 and 6 respond, telling 4 to stop Now 5 and 6 each hold an election

Global State (3) d)Process 6 tells 5 to stop e)Process 6 wins and tells everyone

A Ring Algorithm Election algorithm using a ring.

Mutual Exclusion: A Centralized Algorithm a)Process 1 asks the coordinator for permission to enter a critical region. Permission is granted b)Process 2 then asks permission to enter the same critical region. The coordinator does not reply. c)When process 1 exits the critical region, it tells the coordinator, when then replies to 2

A Distributed Algorithm a)Two processes want to enter the same critical region at the same moment. b)Process 0 has the lowest timestamp, so it wins. c)When process 0 is done, it sends an OK also, so 2 can now enter the critical region.

A Toke Ring Algorithm a)An unordered group of processes on a network. b)A logical ring constructed in software.

Comparison A comparison of three mutual exclusion algorithms. Algorithm Messages per entry/exit Delay before entry (in message times) Problems Centralized32Coordinator crash Distributed2 ( n – 1 ) Crash of any process Token ring 1 to 0 to n – 1 Lost token, process crash

The Transaction Model (1) Updating a master tape is fault tolerant.

The Transaction Model (2) Examples of primitives for transactions. PrimitiveDescription BEGIN_TRANSACTIONMake the start of a transaction END_TRANSACTIONTerminate the transaction and try to commit ABORT_TRANSACTIONKill the transaction and restore the old values READRead data from a file, a table, or otherwise WRITEWrite data to a file, a table, or otherwise

The Transaction Model (3) a)Transaction to reserve three flights commits b)Transaction aborts when third flight is unavailable BEGIN_TRANSACTION reserve WP -> JFK; reserve JFK -> Nairobi; reserve Nairobi -> Malindi; END_TRANSACTION (a) BEGIN_TRANSACTION reserve WP -> JFK; reserve JFK -> Nairobi; reserve Nairobi -> Malindi full => ABORT_TRANSACTION (b)

Distributed Transactions a)A nested transaction b)A distributed transaction

Private Workspace a)The file index and disk blocks for a three-block file b)The situation after a transaction has modified block 0 and appended block 3 c)After committing

Writeahead Log a) A transaction b) – d) The log before each statement is executed x = 0; y = 0; BEGIN_TRANSACTION; x = x + 1; y = y + 2 x = y * y; END_TRANSACTION; (a) Log [x = 0 / 1] (b) Log [x = 0 / 1] [y = 0/2] (c) Log [x = 0 / 1] [y = 0/2] [x = 1/4] (d)

Concurrency Control (1) General organization of managers for handling transactions.

Concurrency Control (2) General organization of managers for handling distributed transactions.

Serializability a) – c) Three transactions T 1, T 2, and T 3 d) Possible schedules BEGIN_TRANSACTION x = 0; x = x + 1; END_TRANSACTION (a) BEGIN_TRANSACTION x = 0; x = x + 2; END_TRANSACTION (b) BEGIN_TRANSACTION x = 0; x = x + 3; END_TRANSACTION (c) Schedule 1x = 0; x = x + 1; x = 0; x = x + 2; x = 0; x = x + 3Legal Schedule 2x = 0; x = 0; x = x + 1; x = x + 2; x = 0; x = x + 3;Legal Schedule 3x = 0; x = 0; x = x + 1; x = 0; x = x + 2; x = x + 3;Illegal (d)

Two-Phase Locking (1) Two-phase locking.

Two-Phase Locking (2) Strict two-phase locking.

Pessimistic Timestamp Ordering Concurrency control using timestamps.