01A command table entry has a handler but no flags. Which later systems lose information: AOF, replication, cluster routing, transactions, or ACLs?introScenarioA new command was registered in the command table with a working handler function but an empty flags field.AOnly ACLs lose information; the other systems inspect the command's runtime effects rather than its static flags.BAOF, replication, cluster routing, transactions, and ACLs all lose metadata because flags explain command effects, key positions, and execution constraints.COnly cluster routing suffers, because flags exist mainly to locate the key arguments for slot hashing.DNone of them lose information as long as the handler runs correctly; flags are documentation for humans and for the documentation generator that renders the command reference.
02Predict how dispatch handles `GET a b`, `NOPE a`, and `SET a 1` while the client is inside `MULTI`.introScenarioA client in the middle of building a MULTI transaction sends three different commands to the dispatcher.AGET a b receives an arity error, NOPE receives an unknown-command error, and SET a 1 inside MULTI is queued if allowed by client and command state.BAll three are queued, because MULTI defers every check until EXEC runs the batch, since the queue exists precisely to postpone work until the batch is complete.CGET a b queues successfully since arity is checked at EXEC, NOPE aborts the connection, and SET a 1 executes immediately.DGET a b and NOPE a abort the transaction silently, while SET a 1 executes immediately because writes cannot be queued.
03Why should arity be validated before a command reaches its handler?appliedScenarioYou are deciding which checks belong in the dispatcher and which belong inside each command's handler.AArity must be checked first because RESP cannot frame an array whose size differs from the command's declared arity, so the parser would reject the extra argument before dispatch ever sees it.BIt is purely a performance optimization, since rejecting early saves the cost of one function call.CHandlers are unable to return error replies, so all validation has to happen before they run.DArity validation belongs before the handler so handlers can assume a valid argument shape and avoid mixing semantic logic with generic errors.
04A command touches keys at positions 1, 3, and 5. Why might cluster mode need that metadata before execution?appliedScenarioA command's table entry declares that its keys sit at argument positions 1, 3, and 5.ACluster mode rewrites those arguments to include node IDs before the handler ever sees them.BThe metadata is needed after execution instead, to know which slots to invalidate in client caches.CCluster mode needs key-position metadata before execution to compute hash slots and reject or redirect commands that target the wrong owner.DKey positions matter only for ACL checks; cluster routing always hashes the first argument by convention, which is also why single-key commands need no declared positions at all.
05Distinguish command errors that should become RESP error replies from protocol errors that may close the connection.advancedScenarioYour dispatcher must decide between answering with an error and dropping the connection for different kinds of bad input.ACommand errors become RESP error replies for a valid parsed command, while protocol errors mean the byte stream is invalid and may require closing the connection.BBoth kinds should close the connection, because any error leaves the stream in an unknown state.CBoth kinds should become RESP error replies, because closing a connection loses the replies queued for earlier commands.DProtocol errors become error replies while command errors close the connection, since semantic mistakes are the more serious kind.