01A key is set after a background snapshot begins. Should it appear in that snapshot? Explain using copy-on-write.introScenarioA background save forked two seconds ago, and a client has just SET a brand-new key on the live server.AIt should not appear in that snapshot; copy-on-write lets the child keep the fork-time view while the parent changes later pages.BIt appears in the snapshot, because the child reads live memory and the write happened before the file was finished.CIt appears only if the write landed on a memory page the child had not yet serialized to disk.DIt should not appear, and copy-on-write enforces that by blocking the parent's writes until the child finishes writing the temporary file to disk.
02Why does atomic rename protect the previous valid snapshot?introScenarioThe save path writes the new dump into a temporary file and renames it over the old one only at the very end.ARename is mainly about visibility speed; protection of the old file actually comes from advisory file locks.BRename automatically preserves the old snapshot under a backup suffix in the same directory.CWriting directly into the final filename would be equally safe, provided fsync is called once at the end.DAtomic rename keeps the old valid snapshot in place until the new temporary file is fully written.
03What information must be stored so a hash can be restored with the correct logical behavior?appliedScenarioYou are defining the on-disk record format for hash values in your snapshot file.AOnly the raw field-value bytes, since the loader can infer the type from the shape of the data.BThe snapshot must store logical type, value data, encoding-relevant information, and expiration metadata needed to restore behavior.CThe memory addresses of the hash table's buckets, so the structure can be mapped back to its original location.DThe field-value pairs plus the list of clients that created them, so ownership can be re-established after loading and replay of any transactions that were in flight.
04Why can RDB load faster than replaying a long AOF?appliedScenarioTwo servers restart with the same dataset, one loading an RDB file and the other replaying a week of AOF history.ARDB files are memory-mapped and used in place, so loading costs almost nothing regardless of size.BRDB load skips expiration handling entirely, while AOF replay must evaluate the TTL of every command, which RDB postpones until the dataset is fully resident.CRDB can load faster because it reads a compact serialized dataset instead of replaying every historical write command.DAOF replay is slower only because it fsyncs after each replayed command for safety.
05What data-loss window exists when only periodic RDB snapshots are enabled?advancedScenarioAn operator runs snapshots every five minutes with AOF disabled and asks what crash safety that actually buys.AOnly writes made while a snapshot is actively in progress can be lost; the gaps between snapshots are safe.BNo loss window exists as long as snapshots are scheduled more frequently than the eviction cycle runs.CWrites after the last completed snapshot can be lost if the process crashes before the next snapshot succeeds.DThe window is a single event-loop tick, namely the replies that had not yet been flushed to client sockets.