ASQL docs / Performance & Operations

Durability and checkpoints

Commits

Every commit is appended to the redo log (<root>/sql_db/redo.log) and synced to disk before the client gets its reply. When several transactions commit at once, they share one sync (group commit), waiting at most 100 µs for each other.

AIOS_REDO_SYNC sets when a commit counts as safe:

ValueReply sentLost on a power cut
1 (default)after the log is synced to disknothing
barrierafter an ordered syncthe newest commits; a process crash loses nothing
0once the record is in the file; synced every 200 msabout the last 0.2 s

Checkpoints

A checkpoint writes the tables to disk and starts a new redo log. It runs after 64 MB of redo log, or after 20,000 writes once 30 seconds have passed since the last one, and not while a transaction is open. The server pauses for the copy in memory only; the files are written in the background.

FLUSH TABLES runs a checkpoint now and returns when it is on disk.

Restart

At start, ASQL loads the last checkpoint, then replays the redo logs written since. The data is back exactly as of the last commit.

Backups

See Back up and restore.