Skip navigation links

Package io.atomix.copycat.server.storage

Standalone segmented log for Copycat's Raft implementation.

See: Description

Package io.atomix.copycat.server.storage Description

Standalone segmented log for Copycat's Raft implementation.

Logs are the vehicle through which Copycat servers persist and replicate state changes. The Copycat log is designed specifically for use with the Raft consensus algorithm. The log is partitioned into multiple files called segments. Each segment represents a sequence of indexes in the log. As entries are written to the log and segments fill up, the log rolls over to new segments. Once a completed segment has been written and the entries within it have been committed, the segment is compacted.

Log compaction is a two-stage process. The minor compaction process periodically rewrites segments to remove non-tombstone and snapshot-related entries that have been released by the state machine. The major compaction process periodically rewrites segments to remove tombstones and combines multiple segments together to reduce the number of open file descriptors.

Copycat logs also support snapshotting. Each snapshot taken of the state machine's state is associated with a number of snapshotted entries. When segments are compacted, entries compacted by the last snapshot are removed from segment files on disk.

For more information on Copycat's log and log compaction algorithms, see the log documentation on the Atomix website.

Author:
Jordan Halterman
Skip navigation links

Copyright © 2013–2016. All rights reserved.