diff --git a/docs/internals/compaction.png b/docs/internals/compaction.png new file mode 100644 index 000000000..927ae0b21 Binary files /dev/null and b/docs/internals/compaction.png differ diff --git a/docs/internals/compaction.vsd b/docs/internals/compaction.vsd new file mode 100644 index 000000000..73cc0b061 Binary files /dev/null and b/docs/internals/compaction.vsd differ diff --git a/docs/internals/data-structures.rst b/docs/internals/data-structures.rst index 169b78f54..400a2d6b3 100644 --- a/docs/internals/data-structures.rst +++ b/docs/internals/data-structures.rst @@ -176,6 +176,12 @@ a new segment, while superseded entries are omitted. After each segment an inter commit is written to the new segment. Then, the old segment is deleted (asserting that the reference count diminished to zero), freeing disk space. +A simplified example (excluding conditional compaction and with simpler +commit logic) showing the principal operation of compaction: + +.. figure:: + compaction.png + (The actual algorithm is more complex to avoid various consistency issues, refer to the ``borg.repository`` module for more comments and documentation on these issues.)