Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

1. Define the k-neighbourhood of a processor in the ring.

- The set of processors at a distance at most k from the processor in the ring, to the left or right.

2. How many processors are included in the k-neighbourhood of a processor EL?

- Exactly 2k+1 processors.

3. What happens in the kth phase of the algorithm?

- Processors compete to have the largest id in their 2k-neighbourhood to become a winner.

4. How is the winner determined in each phase of the algorithm?

- The processor with the largest id in its 2k-neighbourhood becomes the winner.

5. How many processors continue to compete in the next phase after winning a
phase?

- Only processors that are winners in the current phase continue to compete in the next.

6. What happens at the end of the algorithm?

- One processor is elected as the leader of the whole ring.

7. What does a processor do in phase 0 of the algorithm?


- Each processor sends a <probe> message containing its identifier to its 1-neighbourhood.

8. When does a processor become a phase 0 winner?

- If it receives a reply from both its neighbors, indicating it has the largest id in its 1-
neighbourhood.

9. What does a processor do in phase k of the algorithm?

- A phase k-1 winner sends <probe> messages with its identifier to its 2k-neighbourhood.

10. How does a processor become a winner in phase k?

- If it receives replies from both directions in its 2k-neighbourhood after sending <probe>
messages.

11. How is the leader elected in the algorithm?

- The processor with the maximal identifier, whose probes are never swallowed, becomes the
leader.

12. What is the time complexity of the O(n log n) Leader Election Algorithm?

- O(n log n) time complexity.

13. What triggers the sending of a reply in the leader election algorithm?

- Probe reaching the end of its neighborhood.

14. When does an initiator proceed to the next phase in the leader election
algorithm?

- After receiving replies from both directions.

15. How many messages can a processor initiate in phase k of the leader
election algorithm?

- At most 4*2^k (probes and replies in both directions).


16. How many processors initiate probes in phase k of the leader election
algorithm?

- For k = 0, every processor. For k > 0, 'winners' in phase k.

17. How many phase k-1 winners occur when packed densely in the leader
election algorithm?

- At most n/(2^k-1 + 1) winners.

18. How many phases are there in the leader election algorithm?

- Approximately log2(n) phases until one winner remains.

19. What is the maximum number of phase k-1 winners in the leader election
algorithm?

- Total number is at most n/(2^k-1 + 1).

20. Can the message complexity be reduced further in the leader election
algorithm?

- Not in the asynchronous model.

21. What is the lower bound for message complexity in an asynchronous leader
election algorithm?

- ü(n log n) message complexity.

22. What types of algorithms are LCR and HS in the context of leader election?

- Comparison-based algorithms using only identifier comparisons.

23. What is the message complexity achievable in synchronous networks for


leader election?

- O(n) if arithmetic operations permitted and time complexity unbounded.


24. What kind of networks do the comparison-based LCR and HS algorithms
work in?

- Synchronous networks.

25. What is the worst-case completion time for leader election?

- 5 message transmission times

26. How many processes in total begin elections when the process with the
lowest id detects a failure?

- N-1 processes altogether

27. What is the best-case completion time when the second-highest id detects
leader failure?

- 1 message transmission time

28. What is the big O notation for the number of election messages in leader
election?

- O(N^2)

29. In which system model is liveness not guaranteed due to timeouts built into
the protocol?

- Asynchronous system model

30. What is used to calculate the worst-case one-way latency in leader election?

- Worst-case processing time + worst-case message latency

31. What approach uses consensus to solve election in Chubby & Zookeeper
systems?

- Each process proposes a value, group reaches consensus on a process’s value


32. Which consensus protocol is used by systems like Google's Chubby and
Apache Zookeeper for elections?

- Paxos

33. What is an essential part of Google's stack that relies on Chubby for locking?

- Server A: Many internal systems like BigTable, Megastore

34. How is a master server elected at all times in Google Chubby's system?

- Potential leader gets votes from other servers, majority becomes new leader

35. What is the centralized service for maintaining configuration information that
uses Zab variant of Paxos for leader election?

- Zookeeper

36. In Zookeeper, what is used to elect the highest-id server as the Master
leader?

- Each server creates a new sequence number for itself, elects highest-id

37. What happens in Zookeeper if the current master fails?

- Initiate election leads to a flood of elections

38. What is the second option implemented in Zookeeper for handling failures in
leader election?

- Monitoring current master, initiate election on failure

39. What does Zookeeper operation 'create' do?

- Creates a znode (parent znode must exist)

40. Explain the operation 'delete' in Zookeeper.


- Deletes a znode (mustn't have children)

41. What is the purpose of the 'exists/ls' operation in Zookeeper?

- Tests whether a znode exists & gets metadata

42. Describe the operation 'getACL' in Zookeeper.

- Gets/sets the ACL for a znode

43. What does the operation 'sync' do in Zookeeper?

- Synchronizes a client's view of a znode with ZooKeeper

44. What are the two core APIs in Zookeeper?

- Java & C

45. What does Zookeeper use 'watches' for?

- To get notifications when a znode changes

46. When are watchers triggered in Zookeeper?

- Triggered by write operations: create, delete, setData

47. What is the function of ACLs (Access Control Lists) in Zookeeper?

- Determines who can perform certain operations on a znode

48. In Zookeeper, what is the 'digest' authentication scheme used for?

- The client is authenticated by a username & password

49. When should Zookeeper not be used, according to the notes?

- To store big data due to high network load and copies


50. What is the main advantage of using Zookeeper for the Fetching Service
(FS)?

- Recovering from failures, guaranteeing availability, decoupling clients from servers

51. How does the Fetching Service use Zookeeper to elect masters?

- To elect masters (leader election)

52. Explain the purpose of ZooKeeper in distributed systems.

- ZooKeeper is used for distributed locking, configuration management, leadership election,


work queues, and more.

53. What key attributes describe data managed by ZooKeeper?

- Small size, performance-sensitive, dynamic, and critical.

54. Describe ZooKeeper's data model in simple terms.

- ZooKeeper uses a central store of key-value pairs for coordinating distributed systems.

55. What are some design goals of ZooKeeper?

- To be simple, replicated, ordered, and fast for large distributed systems.

56. Explain the concept of replicated design in ZooKeeper.

- All servers maintain a copy of the state in memory with a leader elected at startup.

57. How does ZooKeeper ensure strict order access and synchronization?

- By having a shared hierarchal namespace like a standard file system with strictly ordered
access for synchronization.

58. What is the significance of the number stamped with each update in
ZooKeeper?

- The number reflects the order of transactions and is used to implement higher-level
abstractions.

59. How does ZooKeeper handle data access for reads and writes?

- Data access (read/write) is atomic, ensuring consistency and reliability in operations.

60. What is a znode in the context of ZooKeeper's data model?

- A znode is an entity used to store data in ZooKeeper, similar to files/dirs.

61. Explain the data format required for storing data in ZooKeeper.

- Data should be in JSON format, adhering to Java script object notation.

62. What may be violated in Rings Leader Election according to the proof sketch?

- Safety or liveness

63. In Rings with Identifiers, what are differences between indices and ids?

- Indices are for analysis; ids are unique integers available to processors.

64. Explain the concept of a Uniform (Non-anonymous) Algorithm in terms of


state machines.

- One state machine for each id in a uniform algorithm.

65. Describe the LCR algorithm steps for Leader Election in Rings.

- Send id to left if received id is higher; elect self if ids match.

66. What determines message complexity in the analysis of the O(n^2) algorithm
in rings?

- How the ids are arranged

67. In the worst arrangement of ids (decreasing order), how many messages are
sent?
- O(n^2) messages

68. Explain the idea behind reducing messages in the O(n log n) algorithm.

- Smaller ids travel shorter distances in the ring.

69. What is the algorithm that uses O(n log n) messages for Leader Election in
Rings?

- The Hirschberg and Sinclair (HS) algorithm

70. What is the purpose of leader election in cloud computing systems?

- To elect a node responsible for coordination and decision-making.

71. What are some classical leader election protocols mentioned in the notes?

- Ring-based, Bully, and Paxos-like protocols.

72. In what systems are classical leader election protocols commonly used?

- Cloud computing systems.

73. What is the design goal of Zookeeper in distributed applications?

- To provide coordination services for distributed processes.

74. Why is coordination important in distributed systems?

- To ensure proper synchronization and consistency.

75. Explain a race condition in the context of a distributed system.

- It occurs when multiple processes access shared data simultaneously.

76. Describe a scenario that could lead to a deadlock in a distributed system.

- When processes are waiting for each other's resources indefinitely.


77. How does Zookeeper handle coordination among multiple processes?

- By providing a central storage for managing concurrency.

78. How would email processors avoid reading the same emails using
Zookeeper?

- By using coordination mechanisms to ensure every email is indexed only once.

79. What is the message complexity in an asynchronous ring?

- Theta(n log n) messages.

80. In which scenario does a synchronous ring require Theta(n) messages?

- Under certain conditions.

81. What are the bounds for message complexity in the discussed systems?

- All bounds are asymptotically tight.

82. Who presented different algorithms for leader election in a ring topology?

- Dr. Rajiv Misra.

83. What are the two types of rings considered for leader election algorithms?

- Anonymous/non-anonymous and uniform/non-uniform rings.

84. What algorithms were discussed for the leader election problem?

- Ring LE and Bully LE algorithms.

85. Why is leader election essential in distributed systems?

- For coordination among distributed servers.

86. What is the primary goal of an election algorithm in message-passing


systems?

- Elect one leader among non-faulty processes.

87. Define the System Model for leader election as described in the notes.

- N processes, each with a unique id, messages eventually delivered, failures possible.

88. What safety and liveness properties must an election algorithm guarantee?

- Safety: Leader's election result. Liveness: Termination.

89. How many elections can a process call for at a time?

- A process can call for at most one election at a time.

90. What must the result of an election not depend on as per the notes?

- The process that calls for the election.

91. What is Katta in relation to ZooKeeper?

- Katta is a distributed indexer that utilizes ZooKeeper for coordination.

92. How does Katta distribute indexing work?

- Katta divides the work of indexing using shards assigned by a master server.

93. Explain the role of ZooKeeper in Katta's operation.

- ZooKeeper is used in Katta to track slave servers' status, handle master failover, and manage
shard assignments to slaves.

94. What is the Yahoo! Message Broker (YMB) in relation to ZooKeeper?

- YMB is a distributed publish-subscribe system that utilizes ZooKeeper for managing topics
and system operation.
95. How are topics managed in the Yahoo! Message Broker?

- Each topic has a child znode with primary, backup server details, and subscriber information.

96. What is the purpose of using ZooKeeper in YMB?

- ZooKeeper is used in YMB to manage topic distribution, handle machine failures, and control
system operation.

97. How does ZooKeeper handle processes in distributed systems?

- ZooKeeper employs a wait-free approach by exposing wait-free objects to clients.

98. What throughput values can ZooKeeper achieve for read-dominant


workloads?

- ZooKeeper can achieve throughput values of hundreds of thousands of operations per second.

99. What does ZooKeeper use to achieve high throughput values?

- ZooKeeper uses fast reads with watches, along with local replicas for serving operations.

100. What is the purpose of leader election in rings?

- To choose one processor as the leader in a message-passing system.

101. Define the Leader Election (LE) problem in rings.

- Processors decide to be a leader or non-leader, with only one processor as the leader.

102. How does a leader election solve the deadlock problem?

- By electing one processor as a leader to break the deadlock in a cycle.

103. What happens once a processor enters an elected state?

- It remains in an elected state irreversibly in every admissible execution.


104. How can a leader be utilized in a system?

- To coordinate system activities like creating a spanning tree or token management.

105. What is the characteristic of processors in uniform algorithms?

- Processors in all ring sizes are modeled with the same state machine.

106. Explain the impossibility of leader election in anonymous rings.

- No algorithm exists due to all processors behaving identically without unique identifiers.

107. What triggers the initiation of an Election message in the Ring Election
Protocol?

- A process discovering the old coordinator has failed.

108. How does a process determine whether to forward an Election message in


the Ring Election Protocol?

- By comparing the attributes in the received message with its own.

109. What happens if an Election message's attribute is smaller than the


receiving process' attribute?

- The receiving process forwards the message.

110. When does a process become the new coordinator in the Ring Election
Protocol?

- If the received id:attr matches its own, indicating the greatest attribute.

111. What action does a process take upon receiving an 'Elected' message in
the Ring Election Protocol?

- It sets its variable elected, forwarding the message unless it is the new coordinator.

112. What is the goal of the leader election in the Ring Election Protocol?
- To elect the process with the highest id as the leader.

113. Why does Zookeeper require majority for electing a Leader?

- To ensure consistency and avoid chaos with each data center having its own Leader.

114. What happens if an ensemble over two data centers loses network
connectivity without majority requirement?

- Each data center would have its own Leader leading to inconsistency and chaos.

115. How does Zookeeper handle session management for clients?

- It creates sessions with timeout periods and manages them using heartbeats.

116. How are ephemeral nodes handled in Zookeeper on session expiration?

- Ephemeral nodes are lost when a session expires.

117. What role does Zookeeper play in coordinating servers and clients?

- It acts as a central agency where servers create ephemeral nodes and clients query for
available servers.

118. How does Zookeeper help clients keep track of available servers when
some servers go down?

- Clients query Zookeeper for the most recent list of servers, ensuring efficient coordination.

119. What guarantees does Zookeeper provide in terms of consistency and


atomicity?

- Zookeeper ensures sequential consistency and atomicity in updates from clients.

120. Why is election related to the consensus problem?

- Election is related to consensus because solving election implies solving consensus.


121. What is the Bully Algorithm?

- The Bully Algorithm is a leader election algorithm where processes elect a coordinator based
on process IDs.

122. How does a process initiate an election in the Bully Algorithm?

- A process initiates an election by sending an Election message if it does not have the highest
ID.

123. What happens if a process receives no answer within a timeout in the Bully
Algorithm?

- If a process receives no answer within a timeout, it becomes the leader and sends
Coordinator message.

124. How does a process respond to an Election message in the Bully


Algorithm?

- A process replies with an OK message and may start its own leader election protocol.

125. What triggers a new election run in the Bully Algorithm?

- A new election run is triggered if no Coordinator message is received after a timeout.

126. How are timeouts set in the Bully Algorithm?

- Timeouts are set based on worst-case time to complete an election, such as 5 message
transmission times.

127. What is the goal of the leader election process discussed?

- To elect the highest ID process as the leader.

128. In the worst-case scenario, how many messages are required for the
election process?

- (3N-1) messages are required.


129. What is the message complexity in the best-case scenario of the leader
election process?

- 2N messages.

130. How does each process handle multiple initiators in the leader election
process?

- Each process remembers the highest ID initiator and ignores lower ones.

131. What happens if a failure occurs during the leader election process?

- If a failure occurs, the liveness property is violated.

132. What is the first option to fix failures in the leader election process?

- Have the predecessor or successor of the leader detect and restart the election.

133. What is the second option for fixing failures in the leader election process?

- Using a failure detector to detect failures and initiate a new election.

You might also like