01If both RDB and AOF files exist, why should recovery follow configuration rather than load both in arbitrary order?introScenarioA restarting server finds both a snapshot file and an append-only log in its data directory.ALoading both is harmless because key operations are idempotent, so configuration merely picks the faster file.BThe file with the newer modification time should always win, and configuration simply records that automatic choice.CConfiguration defines the source of truth and precedence; loading both arbitrarily can replay stale or duplicate state.DRDB and AOF describe two different keyspaces, so recovery must always load both of them, ordered by size.
02Which recovery path reconstructs state by deserializing objects, and which reconstructs state by executing mutations?introScenarioYou are documenting how each persistence file turns back into a live in-memory dataset.ABoth paths replay commands, with RDB being simply a compressed encoding of the same command log.BRDB reconstructs state by deserializing saved objects, while AOF reconstructs state by executing stored mutations in order.CBoth paths deserialize objects, with AOF differing only by storing its objects incrementally over time.DAOF deserializes objects while RDB executes mutations, which is why loading an RDB file is slower, since it goes through the ordinary command execution path.
03Why should normal clients receive a loading error or wait while recovery is incomplete?appliedScenarioClients reconnect quickly after a restart, while the server is still in the middle of loading its data files.ANormal clients must wait or receive a loading error because the in-memory keyspace and metadata are not coherent yet.BClients may safely read but not write during loading, because reads cannot observe an incoherent keyspace.CClients should be served directly from the data files on disk while memory fills up in the background.DThe loading error exists only to trigger client-side failover, since a single node could safely serve early while the rest of the dataset streams in behind them.
04What should happen to a key whose absolute expiration time passed while the server was offline?appliedScenarioThe data files contain a key whose absolute expiration timestamp falls inside the window when the server was off.AIt loads normally and expires on first access, exactly like any other key expiring at runtime, preserving the lazy-deletion semantics used at runtime.BIt loads with its TTL restarted from boot, granting the key one more full lifetime.CRecovery aborts with an error, since an expired key in a data file is a sign of file corruption.DThe key should be filtered out during recovery because its absolute expiration time is already in the past.
05Why must AOF replay avoid live-client side effects such as sending network replies?advancedScenarioYou are implementing AOF replay and must decide how it differs from executing commands for live clients.AAOF replay is internal recovery work, so it should apply mutations without sending live-client network replies or triggering external effects.BReplay must send replies, because monitoring tools rely on them to verify each replayed command succeeded.CReplies during replay are harmless since no clients are connected; the rule exists purely for code symmetry.DReplay avoids replies only as a speed optimization, and with fast disks it would be acceptable to send them.