CS FundamentalsModerateGATE CS

Which statement correctly states the write-ahead logging (WAL) rule?

  1. A. A page is written only after the log records for its changes are stable, and commit waits for all its log records
  2. B. The data page must reach disk before its log record, so the log can later be verified against it
  3. C. Log records are written only at checkpoints, together with every dirty page in the buffer pool
  4. D. Only the commit record must be forced at commit; earlier update records may still be lost in a crash

Correct answer: A. A page is written only after the log records for its changes are stable, and commit waits for all its log records

WAL forces undo information to the log before the page it describes can overwrite the old value, and forces all of a transaction's log records (including commit) before reporting the commit. Writing the page first could leave an uncommitted change with no undo record.

More DBMS and SQL questions

Exams that ask this topic