Typos
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>pull/8439/head
parent
fdf6c05a97
commit
eed3cf588c
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
|
|
||||||
-- A unique and immutable mapping between instance name and an integer ID. This
|
-- A unique and immutable mapping between instance name and an integer ID. This
|
||||||
-- let's us refer to instances via a small ID in e.g. stream tokens, without
|
-- lets us refer to instances via a small ID in e.g. stream tokens, without
|
||||||
-- having to encode the full name.
|
-- having to encode the full name.
|
||||||
CREATE TABLE instance_map (
|
CREATE TABLE instance_map (
|
||||||
instance_id SERIAL PRIMARY KEY,
|
instance_id SERIAL PRIMARY KEY,
|
||||||
|
|
|
@ -219,7 +219,7 @@ def _filter_results(
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Filter results from fetching events in the DB against the given tokens.
|
"""Filter results from fetching events in the DB against the given tokens.
|
||||||
|
|
||||||
This is necessary to handle the case where the tokens include positions
|
This is necessary to handle the case where the tokens include position
|
||||||
maps, which we handle by fetching more than necessary from the DB and then
|
maps, which we handle by fetching more than necessary from the DB and then
|
||||||
filtering (rather than attempting to construct a complicated SQL query).
|
filtering (rather than attempting to construct a complicated SQL query).
|
||||||
"""
|
"""
|
||||||
|
@ -477,7 +477,7 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore, metaclass=abc.ABCMeta):
|
||||||
|
|
||||||
def f(txn):
|
def f(txn):
|
||||||
# To handle tokens with a non-empty instance_map we fetch more
|
# To handle tokens with a non-empty instance_map we fetch more
|
||||||
# results than necessary and the filter down
|
# results than necessary and then filter down
|
||||||
min_from_id = from_key.stream
|
min_from_id = from_key.stream
|
||||||
max_to_id = to_key.get_max_stream_pos()
|
max_to_id = to_key.get_max_stream_pos()
|
||||||
|
|
||||||
|
@ -538,7 +538,7 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore, metaclass=abc.ABCMeta):
|
||||||
|
|
||||||
def f(txn):
|
def f(txn):
|
||||||
# To handle tokens with a non-empty instance_map we fetch more
|
# To handle tokens with a non-empty instance_map we fetch more
|
||||||
# results than necessary and the filter down
|
# results than necessary and then filter down
|
||||||
min_from_id = from_key.stream
|
min_from_id = from_key.stream
|
||||||
max_to_id = to_key.get_max_stream_pos()
|
max_to_id = to_key.get_max_stream_pos()
|
||||||
|
|
||||||
|
@ -1065,10 +1065,10 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore, metaclass=abc.ABCMeta):
|
||||||
else:
|
else:
|
||||||
order = "ASC"
|
order = "ASC"
|
||||||
|
|
||||||
# The bounds for the stream tokens are complicated by the fact the fact
|
# The bounds for the stream tokens are complicated by the fact
|
||||||
# that we need to handle the instance_map part of the tokens. We do this
|
# that we need to handle the instance_map part of the tokens. We do this
|
||||||
# by fetching all events between the min stream token and the maximum
|
# by fetching all events between the min stream token and the maximum
|
||||||
# stream token (as return by `RoomStreamToken.get_max_stream_pos`) and
|
# stream token (as returned by `RoomStreamToken.get_max_stream_pos`) and
|
||||||
# then filtering the results.
|
# then filtering the results.
|
||||||
if from_token.topological is not None:
|
if from_token.topological is not None:
|
||||||
from_bound = from_token.as_tuple()
|
from_bound = from_token.as_tuple()
|
||||||
|
|
|
@ -406,7 +406,7 @@ class RoomStreamToken:
|
||||||
respective streams.
|
respective streams.
|
||||||
|
|
||||||
The format of the token in such case is an initial integer min position,
|
The format of the token in such case is an initial integer min position,
|
||||||
followed by the mapping of instance ID to position seperate by '.' and '~':
|
followed by the mapping of instance ID to position separated by '.' and '~':
|
||||||
|
|
||||||
m{min_pos}.{writer1}~{pos1}.{writer2}~{pos2}. ...
|
m{min_pos}.{writer1}~{pos1}.{writer2}~{pos2}. ...
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue