全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Append-only log, replay, compaction?

又称: append-only log · log replay · compaction (log)

Definition 31.5 University Computer Science — Year 2 · 第 31 章 — Project: A Key-Value Server

An append-only log is a file to which records are only ever added at the end. To replay a log of changes is to apply its records in order to an empty state. To compact it is to replace it by a shorter log whose replay gives the same state.

The record of SET a 1, byte by byte: four bytes of length, four of CRC, then the command as it is printed. A record is 8 bytes longer than its command.
The record of SET a 1, byte by byte: four bytes of length, four of CRC, then the command as it is printed. A record is 8 bytes longer than its command.
A crash in the middle of an append. The restart replays the three complete records, cuts the file after them, and the next change is appended there.
A crash in the middle of an append. The restart replays the three complete records, cuts the file after them, and the next change is appended there.
在原文中阅读 →