Velocer › Flashcards › University of Illinois Urbana-Champaign › CS 425: Distributed Systems · UIUC
CS 425: Distributed Systems · UIUC
Putting my CS 425 flashcards up here. quick review before exams. · by cu_flashcards · 172 cards
- What is Lamport's quip about distributed systems?A distributed system is one in which a machine you never heard of can fail and leave your own computer unusable.
- How do textbooks typically describe a distributed system?As independent computers that appear as a single computer to users, or as several computers working together.
- What is the working definition of a distributed system?Multiple processes or computers connected by a network that communicate by passing messages and have no shared clock or shared memory.
- What two things do distributed systems lack, according to the working definition?No shared clock and no shared memory.
- How do processes in a distributed system communicate?By sending messages over a network.
- Give examples of client–server distributed file systems.NFS (Network File System) is a classic example of a client–server distributed file system.
- What are examples of large-scale distributed systems?The Web, DNS, IoT networks, cloud services, and datacenters.
- What are examples of peer-to-peer distributed systems?Overlay networks such as Gnutella and BitTorrent, and blockchains.
- What does transparency mean as a distributed system design goal?Users should perceive the system as a single coherent computer rather than a collection of separate machines.
- What does heterogeneity mean as a design goal?The system should work across diverse hardware, software, and network components.
- What does scalability mean as a design goal?The system should continue to perform well as the number of users, nodes, or workload grows.
- Why is concurrency a key design goal in distributed systems?Multiple processes execute simultaneously and may access shared resources, so the system must handle concurrent operations correctly.
- Why is robustness important in distributed systems?Components and machines can fail independently, so the system must continue functioning despite partial failures.
- What is a public cloud?A cloud that sells services to any paying customer, such as S3 storage billed per GB-month or EC2 VMs billed per hour.
- What is a private cloud?A cloud that serves the staff of a single organization rather than any paying customer.
- What is a Clos or fat-tree network topology used for?It is a network topology used to interconnect nodes in a datacenter, as an alternative to a hierarchical topology.
- What eras preceded modern clouds in the evolution of computing infrastructure?Timesharing, then grids, then clouds.
- What does the Map phase do in MapReduce?It processes each input record independently and emits intermediate key/value pairs, such as (word, 1) for word count.
- What does the Reduce phase do in MapReduce?It merges all values that share a key (e.g., summing counts) and is called once per key with that key's value list.
- How are keys assigned to reducers in MapReduce?By hash partitioning: reducer = hash(key) mod R, where R is the number of reducers.
- Give an example of a MapReduce application for building a reverse web-link graph.The map emits (target, source) pairs and the reduce lists all sources for each target.
- What is YARN?Yet Another Resource Negotiator: a resource management layer that treats each server as a set of containers with fixed CPU and memory.
- What are the two main components of YARN's architecture?A global Resource Manager that schedules resources, and a Node Manager daemon running on each server.
- What is a container in YARN?A unit of resources on a server with a fixed allocation of CPU and memory.
- In word count, what key/value pair does the map function emit?(word, 1) for each word occurrence.
- How many times is the reduce function called per key?Once per key, receiving that key along with its full list of values.
- What does distributed grep do in MapReduce?It scans input records in parallel across nodes and emits matches, with reduce collecting the matching results.
- What is the formula for choosing a reducer for a key?reducer = hash(key) mod R, where R is the number of reducers.
- In push gossip, how does a process spread a message each round?A process holding a message sends it to b random targets each round.
- How does pull gossip work?Processes periodically ask random other processes for new messages.
- What is push–pull gossip?A gossip scheme that combines both push (sending to random targets) and pull (requesting new messages from random peers).
- According to epidemic analysis, how many rounds does gossip need for nearly all nodes to receive a message?Within c log n rounds, all but a tiny fraction of nodes receive the message.
- What message cost per node does epidemic analysis predict for gossip?Each node sends only O(cb log n) messages.
- What are the key advantages of gossip protocols?They provide low latency, lightweight communication, and high fault tolerance.
- What two components make up a membership protocol?A failure detector and a dissemination component that spreads information about joins, leaves, and failures.
- What is completeness in a failure detector?The property that every failure is eventually detected.
- What is accuracy in a failure detector?The property that no live member is mistakenly detected as failed.
- Why can't a failure detector guarantee both completeness and accuracy over lossy networks?Guaranteeing both would effectively solve consensus, which is impossible over lossy networks; real systems guarantee completeness and accept some inaccuracy.
- What are the drawbacks of centralized heartbeating?It has a single point of failure and creates a hot spot at the central node.
- What is the weakness of ring heartbeating?It misses simultaneous failures, since each node only monitors a neighbor.
- What is the problem with all-to-all heartbeating?Load is equal across members, but a single lost heartbeat causes a false positive.
- How does gossip-style heartbeating detect failures?Each node gossips its membership list with heartbeat counters and local times; lists merge by keeping higher counters, and an entry not updated within T_fail is marked failed, then removed after T_cleanup.
- Why does gossip-style heartbeating wait T_cleanup before removing a failed entry?So that stale entries are not revived by older gossip messages.
- How does SWIM detect a failed member?Each protocol period a member pings a random target; if there is no ack, it asks K random members to ping-req the target indirectly.
- What are SWIM's key performance properties?Expected detection time is constant, load is constant per member, and false-positive probability falls exponentially in K.
- What is the purpose of suspicion in SWIM?A member is first marked suspected rather than failed, giving a live member a chance to refute the suspicion.
- What are incarnation numbers and who increments them?Incarnation numbers are incremented only by the member itself, allowing a live member to refute suspicion.
- How do suspicion states and incarnation numbers interact?Within one incarnation, Suspect overrides Alive, and Failed overrides everything.
- What is the role of central servers in Napster?They store a directory of (filename, peer address) entries but no files; clients search the servers, ping candidate hosts, and download directly from the best one.
- What are the main problems with Napster's architecture?Congestion and single point of failure at the server, no security, and legal liability.
- How do new peers join a peer-to-peer system via an introducer?A new peer contacts a well-known server (the introducer) that seeds its neighbor table.
- How does Gnutella route queries without servers?Peers flood Query messages to neighbors with a TTL that is decremented each hop; QueryHits travel back along the reverse path, and then the file transfers directly.
- What is the purpose of TTL in Gnutella, and what is a typical starting value?TTL limits the scope of flooding by being decremented each hop; it typically starts around 7–10.
- How does Gnutella handle firewalled peers during file transfer?It uses Push messages to handle firewalled peers.
- What are the main problems with Gnutella?Flooding traffic and many freeloaders.
- How does FastTrack (Kazaa) differ from Gnutella?Like Gnutella, but some peers act as supernodes, each holding a directory for nearby peers.
- In Chord, how are node and key IDs assigned?Node and key IDs are hashed onto a ring of size 2^m.
- In Chord, where does a key live?A key lives at its successor: the first node at or clockwise after it on the ring.
- What is the i-th entry in a Chord finger table at node n?The first node with id ≥ (n + 2^i) mod 2^m.
- What is the lookup complexity in Chord?Lookups follow fingers and take O(log N) hops.
- What are virtual nodes in Chord and why are they used?Each machine is represented as several ring points; virtual nodes reduce load imbalance.
- What problem does churn cause in Chord?Churn causes heavy key copying and stabilization traffic.
- What is a key–value store, in one sentence?A distributed dictionary that supports get(key) and put(key, value) operations.
- What does "scale out" mean, and how does it differ from "scale up"?Scale out means adding more commodity machines over time; scale up means buying bigger, more powerful machines.
- What does NoSQL stand for, and what schema limitations do NoSQL tables often have?NoSQL means "not only SQL." Tables may lack schemas, rows may be missing columns, and joins/foreign keys are often unsupported.
- In Cassandra, what role does a coordinator play?The coordinator receives each request and forwards it to the replicas responsible for that key.
- Describe the write path in Cassandra from client write to disk.Writes go to a commit log, then to an in-memory memtable (a write-back cache); memtables later flush to immutable SSTables on disk.
- What is an LSM-tree design in the context of Cassandra?A storage design where writes accumulate in an in-memory memtable and are flushed to immutable, indexed SSTables on disk, with compaction merging them.
- What is compaction in Cassandra?The process that merges SSTables to reclaim space and remove obsolete data, including tombstones.
- What is a tombstone in Cassandra?A marker written for a delete; it is removed during compaction.
- What is hinted handoff in Cassandra?If a replica is down, the coordinator stores the write and replays it later, keeping the system writable.
- Why does a read quorum see the most recent write?Any two majorities intersect, so the read quorum overlaps the most recent write quorum and sees the latest write.
- How does a Bloom filter work, and what are its error properties?It is a bit map with several hash functions; it never gives a false negative but may give a false positive.
- What is HBase, and what does it favor?HBase is an open-source implementation of BigTable that favors consistency.
- What does the CAP theorem state about a distributed store?A distributed store can have at most two of Consistency, Availability, and Partition tolerance. Since partitions happen in practice, the real choice is consistency vs. availability.
- What is a consistency model?A contract stating which results a system may return for concurrent reads and writes.
- What is eventual consistency?If writes stop, replicas converge; reads may return any earlier write, and conflicts are resolved (e.g., Cassandra uses latest timestamp wins). It is fast and highly available but hard to program against.
- What is linearizability (strong consistency)?Every operation appears to take effect instantly at one point between its start and end, forming a total order that respects real time and looks like a single copy. It is easy to program but costs performance and availability.
- How does sequential consistency differ from linearizability?Sequential consistency requires some total order consistent with each client's program order, but that order need not respect real time; linearizability requires the order to respect real time.
- What is causal consistency?Operations respect the causality partial order: same-client order, plus writes that a read observed.
- What are monotonic reads as a session guarantee?Later reads never see older state than earlier reads by the same client.
- What are monotonic writes as a session guarantee?A client's writes are seen by others in the order the client issued them.
- What is the read-my-writes session guarantee?A client's read sees its own earlier write.
- Which letter of CAP does linearizability correspond to?The C (Consistency) in CAP.
- Why is eventual consistency hard to program against?Reads may return any earlier write, so applications must tolerate stale or conflicting data and rely on conflict resolution such as latest-timestamp-wins.
- What is the trade-off of choosing linearizability?It is easy to program against because it behaves like a single copy, but it costs performance and availability.
- In CAP, why is the real choice between consistency and availability rather than involving partition tolerance?Because network partitions happen in practice, partition tolerance is not optional, so systems must choose between consistency and availability during a partition.
- What is clock skew?The difference in clock values between two clocks at a given moment.
- What is clock drift?The difference in clock rates; nonzero drift causes clock skew to grow over time.
- If two clocks each have maximum drift rate MDR relative to UTC, at what combined rate can they diverge?At 2·MDR, since each can drift by up to MDR in opposite directions.
- How often must clocks be resynchronized to keep skew below M?At least every M/(2·MDR), where MDR is the maximum drift rate.
- What is external synchronization?Each clock is kept within a bound D of an authoritative source such as UTC.
- What is internal synchronization?Every pair of clocks in the system is kept within a bound D of each other.
- If clocks are externally synchronized with bound D, what internal synchronization bound does that imply?Internal synchronization with bound 2D, since two clocks can each be up to D from the source.
- Why should clocks be sped up or slowed down rather than set backward?Setting a clock backward can break assumptions of monotonically increasing time, causing incorrect behavior in programs and protocols.
- What is NTP?A widely used external clock synchronization protocol that keeps hosts' clocks close to UTC via time servers.
- Why is internal synchronization alone insufficient?Without an external reference, the whole group of clocks can drift together away from real time.
- What distinguishes an asynchronous distributed system from a synchronous multiprocessor regarding time?Each host has its own clock and there are no bounds on message or processing delays, so clocks are not inherently synchronized.
- What does the happens-before relation (→) capture?On a single process, earlier events precede later ones; a send precedes its receive; and the relation is transitive. Events not ordered either way are concurrent.
- In Lamport clocks, what does the rule L(e) < L(f) imply about the relation between events e and f?It does not imply e → f. Lamport clocks guarantee that if e → f then L(e) < L(f), but not the converse.
- How does a process update its Lamport clock on a local event or send?It increments its integer counter and stamps the event with the new value.
- How does a process update its Lamport clock when receiving a message?It sets C = max(C_local, C_msg) + 1.
- What is the key limitation of Lamport clocks?They can order events consistently with causality, but the timestamp order does not determine causality: L(e) < L(f) does not mean e → f.
- How does a process increment its vector clock on a local event?It increments its own component V_i[i].
- What does a message carry in a vector clock system?The sender's full vector clock, so the receiver can merge it.
- How does a process update its vector clock on receiving a message?For all j ≠ i, set V_i[j] = max(V_msg[j], V_i[j]); then increment its own component V_i[i].
- Using vector clocks, how do you determine that event e happens before event f?V(e) ≤ V(f) componentwise and V(e) ≠ V(f).
- What do incomparable vector clocks indicate about two events?The events are concurrent (neither happens before the other).
- What does it mean for two events to be concurrent in logical time?Neither event happens before the other; they are not related by the happens-before relation.
- What is the happens-before rule for a send and its corresponding receive?The send event happens before the receive event.
- Why can't Lamport clocks detect concurrency?Because the converse of the implication fails: L(e) < L(f) does not guarantee e → f, so concurrent events may still have ordered timestamps.
- What data structure does each process maintain with vector clocks in an N-process system?An array V_i[1..N] of counters, one per process.
- How do vector clocks differ from Lamport clocks in what they can determine?Vector clocks can determine both causality (e → f) and concurrency, whereas Lamport clocks only ensure e → f implies L(e) < L(f).
- What is a global snapshot in a distributed system?A record of each process's state plus the in-transit messages on each channel. It is used for checkpointing, distributed garbage collection, deadlock detection, and termination detection.
- What assumptions does the Chandy–Lamport algorithm make?FIFO channels in each direction, no lost or duplicated messages, no failures, and no pausing of the application.
- In Chandy–Lamport, what does the initiator do first?It records its own state, sends a marker on every outgoing channel, and begins recording every incoming channel.
- In Chandy–Lamport, what does a process do upon receiving its first marker on channel C_ki?It records its own state, marks C_ki as empty, sends markers out on all channels, and starts recording the other incoming channels.
- In Chandy–Lamport, how is a channel's state determined when a later marker arrives on a channel already being recorded?The channel's state is the set of messages received on that channel since recording began.
- When does the Chandy–Lamport algorithm terminate?When every process has received a marker on all of its incoming channels.
- What is a cut in a distributed computation?A cut takes a prefix of the events of each process.
- What is a consistent cut?A cut that is closed under the happens-before relation: if event f is in the cut and e happens-before f, then e is also in the cut.
- What guarantee does Chandy–Lamport provide about the resulting cut?It always produces a consistent cut.
- What is a marker in the Chandy–Lamport algorithm?A special control message sent along each channel to signal processes to record their state and channel contents.
- What is the difference between unicast, broadcast, and multicast?Unicast targets one receiver, broadcast targets everyone, and multicast targets a group of receivers.
- In multicast, what distinguishes receiving a message from delivering it?Receiving means the message arrives at the multicast layer; delivering means it is handed up to the application. Undeliverable messages are buffered.
- What does FIFO ordering guarantee in multicast?Each sender's multicasts are delivered in the order they were sent, at every process.
- What does causal ordering guarantee in multicast?If multicast(m) happens before multicast(m'), then every process delivers m before m'. Causal ordering implies FIFO ordering, but not the reverse.
- What does total ordering guarantee in multicast?All processes deliver all multicasts in the same order.
- How does a sequencer implement total ordering?A sequencer (leader) assigns increasing sequence numbers to messages, and receivers deliver messages in sequence-number order.
- What mechanism does FIFO ordering use, and what does causal ordering use?FIFO ordering uses per-sender sequence numbers; causal ordering uses vector timestamps.
- What does reliable multicast guarantee?Every correct process delivers the same set of messages. This property is orthogonal to ordering.
- What is virtual (view) synchrony?A form of synchrony in which membership lists (views) change in the same order at all correct processes, and the same set of multicasts is delivered within each view at all correct members.
- What happens in virtual synchrony to a process that missed a message?It is removed from the next view.
- Does virtual synchrony solve consensus?No. It does not solve consensus because of partitions and inaccurate failure detection.
- Does causal ordering imply FIFO ordering, or vice versa?Causal ordering implies FIFO ordering, but FIFO ordering does not imply causal ordering.
- What is the goal of a leader election algorithm?Among the non-faulty processes, elect exactly one leader (typically the highest id or best attribute) and make all processes agree on who it is.
- What does the safety property of leader election require?Each non-faulty process elects the best non-faulty process, or nothing yet—never a wrong or inferior leader.
- What does the liveness property of leader election require?The run terminates and no process ends without a leader.
- How does the ring election algorithm work?An initiator sends Election(own id) clockwise; each process forwards the larger id (replacing it with its own if larger and not yet sent). When a process sees its own id return, it becomes leader and circulates an Elected message.
- What is the worst-case message complexity of ring election?About 3N−1 messages, occurring when the initiator is just after the would-be leader.
- How does the bully algorithm decide the coordinator?A process that knows it has the highest id declares itself coordinator; otherwise it sends Election to all higher ids and waits.
- What happens in the bully algorithm if a process gets no response to its Election messages?After a timeout with no answer, it becomes the coordinator.
- What happens in the bully algorithm if a process receives a response to its Election messages?It waits for a Coordinator message, and restarts the election on timeout.
- What is the worst-case message complexity of the bully algorithm?O(N²) messages.
- How do consensus-based systems like Chubby, ZooKeeper, and Raft elect a leader?Candidates seek a quorum; because quorums intersect, two leaders cannot win at once, though liveness is only eventual.
- Why can't two leaders be elected simultaneously in a quorum-based election?Quorums intersect, so two candidates cannot both obtain a majority quorum at the same time.
- In ring election, when does a process know it is the leader?When it sees its own id return in an Election message.
- In ring election, what does a process do when it receives an Election message with a larger id?It forwards the larger id clockwise rather than its own.
- In the bully algorithm, what message does the elected coordinator send?A Coordinator message, which waiting processes await.
- What are the input and output requirements for each process in the consensus problem?Each process has input 0 or 1 and decides exactly once; all correct processes must decide the same value.
- What does the validity constraint require in consensus?If all processes propose the same value v, then the decided value must be v.
- What does the integrity constraint require in consensus?The decided value must have been proposed by some process.
- What does the non-triviality constraint require in consensus?Both possible outcomes must be reachable from some starting configuration.
- How does a synchronous consensus algorithm handle up to f crashes?It runs f+1 rounds, with each process broadcasting newly learned values each round, then decides (e.g., the minimum).
- Why does the synchronous consensus algorithm work?Because synchronous systems bound message delays, so f+1 rounds suffice to tolerate f crashes.
- What is the FLP impossibility result?In an asynchronous system, no deterministic protocol guarantees consensus even with a single faulty process (Fischer, Lynch, Paterson 1983).
- Who proved the FLP impossibility theorem and when?Fischer, Lynch, and Paterson, in 1983.
- What system model does the FLP impossibility apply to?Asynchronous systems with even one faulty (crashing) process.
- How many rounds does the synchronous crash-tolerant consensus algorithm need for f crashes?f+1 rounds.
- What do processes broadcast in each round of the synchronous consensus algorithm?The values they have newly learned.
- What decision rule is suggested for the synchronous consensus algorithm?Decide, for example, the minimum of the values learned.
- Why can't FLP impossibility be avoided in asynchronous systems?Because without bounds on delays, a single faulty process can prevent the system from ever reaching a decision.
- What two properties does Paxos guarantee?Safety (consensus is never violated) and eventual liveness (it likely finishes when conditions are good). It still cannot beat the FLP impossibility result.
- In Paxos, what happens when a process sees a ballot id higher than the current round's?It aborts the current round, ensuring only the highest ballot makes progress.
- What is state machine replication?Same initial state plus the same commands in the same order yields identical states. Consensus is used to agree on a replicated log of commands.
- What are the three server roles in Raft?Leader, follower, and candidate.
- What are terms in Raft?Monotonically increasing time periods that are persisted; each term starts with an election and has at most one leader (a split vote yields none).
- What fields does a Raft log entry contain?An index, a command, and the term in which it was created. Logs are kept on stable storage.
- How does normal operation work in Raft?The leader appends the client command and replicates it to followers, which append only if their log prefix matches. Once a majority acks, the entry is committed, applied, and the result returned; followers learn of commits in later messages.
- What is Raft's election restriction?A voter refuses a candidate whose log is less up to date (comparing last term, then last index), ensuring the new leader holds all committed entries.
- What safety property does Raft guarantee?No two servers apply different entries at the same index.
- Why can't Paxos beat the FLP result?FLP shows no deterministic consensus algorithm can guarantee both safety and liveness in an asynchronous system with even one faulty process; Paxos only guarantees eventual liveness under good conditions.
Velocer is free: spaced repetition and your own cards from any document.
PDF to flashcards · Lecture to flashcards · Practice exam · Syllabus study plan · Anki import
More decks from University of Illinois Urbana-Champaign
- CS 580: Algorithmic Game Theory · UIUC
- CS 445: Computational Photography · UIUC
- CS 444: Deep Learning for Computer Vision · UIUC
- CS 441: Applied Machine Learning · UIUC
- CS 440: Artificial Intelligence · UIUC
- CS 421: Programming Languages and Compilers · UIUC
- CS 374: Intro to Algorithms and Models of Computation · UIUC
- CS 357: Numerical Methods I · UIUC
- CS 341: System Programming · UIUC
- CS 225: Data Structures · UIUC
- CS 173: Discrete Structures · UIUC