More comments

This commit is contained in:
Erik Johnston 2018-05-17 17:07:08 +01:00
parent 12fd6d7688
commit 0504d809fd
3 changed files with 18 additions and 7 deletions

View File

@ -2,7 +2,8 @@ Changes in <unreleased>
======================= =======================
This release adds an index to the events table. This means that on first This release adds an index to the events table. This means that on first
startup there will be an inceased amount of IO until the index is created. startup there will be an inceased amount of IO until the index is created, and
an increase in disk usage.
Changes in synapse v0.29.0 (2018-05-16) Changes in synapse v0.29.0 (2018-05-16)

View File

@ -33,10 +33,20 @@ class ChunkDBOrderedListStore(OrderedListStore):
"""Used as the list store for room chunks, efficiently maintaining them in """Used as the list store for room chunks, efficiently maintaining them in
topological order on updates. topological order on updates.
A room chunk is a connected portion of the room events DAG. As such it A room chunk is a connected portion of the room events DAG. As such the set
inherits a DAG, i.e. if an event in one chunk references an event in a of chunks in a room inherits a DAG, i.e. if an event in one chunk references
second chunk, then we say that the first chunk references the second, and an event in a second chunk, then we say that the first chunk references the
thus forming a DAG. second, and thus forming a DAG.
Chunks are constructed so that they have the aditional property that for all
events in the chunk, either all of their prev_events are in that chunk or
none of them are. This ensures that no event that is subsequently received
needs to be inserted into the middle of a chunk, since it cannot both
reference an event in the chunk and be referenced by an event in the chunk
(assuming no cycles).
Multiple chunks can therefore happen when the server misses some events,
e.g. due to the server being offline for a time.
The server may only have a subset of all events in a room, in which case The server may only have a subset of all events in a room, in which case
its possible for the server to have chunks that are unconnected from each its possible for the server to have chunks that are unconnected from each

View File

@ -24,7 +24,7 @@ This ordering is therefore opposite to what one might expect when considering
the room DAG, as newer messages would be added to the start rather than the the room DAG, as newer messages would be added to the start rather than the
end. end.
***We therefore invert the direction of edges when using the algorithm*** ***The ChunkDBOrderedListStore therefore inverts the direction of edges***
See: See:
A tight analysis of the KatrielBodlaender algorithm for online topological A tight analysis of the KatrielBodlaender algorithm for online topological
@ -79,7 +79,7 @@ class OrderedListStore(object):
self._insert_before(node_id, None) self._insert_before(node_id, None)
def add_edge(self, source, target): def add_edge(self, source, target):
"""Adds a new edge is added to the graph and updates the ordering. """Adds a new edge to the graph and updates the ordering.
See module level docs. See module level docs.