_____________ SECTION2 Irene Zhang _____________ Table of Contents _________________ 1 Lab 2 architecture 2 State machines 3 Lab 2 specifications .. 3.1 Valid view requirements: .. 3.2 Triggers for a view change: 4 Lab 2 state machine design .. 4.1 View service state .. 4.2 Design hints 1 Lab 2 architecture ==================== - Primary/Backup replication - View service that determines state of the system BUT single point of failure - Primary and backup ping view service - View service has a periodic tick to check on pings - Primary and backup send id and view number on ping, view service responds with view num, primary id and backup id 2 State machines ================ - Example state machine based on variables: view, primary_acked, idle_servers - use switch statement to check current state and make decision where to move 3 Lab 2 specifications ====================== 3.1 Valid view requirements: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. The primary in a view must always be either the primary or the backup of the previous view. This helps ensure that the key/value service's state is preserved. An exception: when the viewservice first starts, it should accept any server at all as the first primary. 2. The backup in a view can be any server (other than the primary), or can be altogether missing if no server is available (represented by an empty string, ""). 3. The primary in the last view acknowledged the last view 3.2 Triggers for a view change: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. View service hasn't received a Ping from the primary or backup for DeadPings PingIntervals 2. the primary or backup crashed and restarted 3. there is no backup and there's an idle server (a server that's been Pinging but is neither the primary nor the backup). 4 Lab 2 state machine design ============================ 4.1 View service state ~~~~~~~~~~~~~~~~~~~~~~ - 3 states: 1. View changing - new view but not acked by primary 2. In view - view acked by primary 3. View pending - idle server exists but view not acked by primary - Current view: view number, primary, backup - primary_acked: t/f, has the primary pinged with view num - idle_servers: servers that are not the primary or backup 4.2 Design hints ~~~~~~~~~~~~~~~~ - Walk through all of the events that might happen in a state (e.g., different messages from servers, different failures) - Ensure that valid view properties are not violated - Check that view service is stuck when its suppose to be and moves on to new view when its suppose to based on triggers