mirror of
https://github.com/element-hq/synapse.git
synced 2025-03-14 11:48:44 +00:00
There is a bug with the `StreamChangeCache` where it would incorrectly return that all entities had changed if asked for entities changed *since* the earliest stream position. Note that for streams we use the inequalities: `$min_stream_id < stream_id <= $max_stream_id`, i.e. when we ask the stream change cache for all things that have changed since `$stream_id` we don't care for events that happened *at* `$stream_id`. Specifically: `_earliest_known_stream_pos` is the position at which we know that we'll have entries for all changes since that point, we can use the cache for any stream IDs that equal `_earliest_known_stream_pos`. `_earliest_known_stream_pos` is set in three places: - On startup we set it either to: - the current maximum stream ID, with not prefilled values; or - the minimum of the latest N values we pulled from the DB - When we evict items from the bottom, we set it to the stream ID of the evicted items. This was changed in https://github.com/matrix-org/synapse/pull/14435, but I think we were overly conservative there. --------- Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> |
||
---|---|---|
.. | ||
caches | ||
__init__.py | ||
async_helpers.py | ||
batching_queue.py | ||
cancellation.py | ||
check_dependencies.py | ||
daemonize.py | ||
distributor.py | ||
events.py | ||
file_consumer.py | ||
frozenutils.py | ||
gai_resolver.py | ||
hash.py | ||
httpresourcetree.py | ||
iterutils.py | ||
linked_list.py | ||
logcontext.py | ||
logformatter.py | ||
macaroons.py | ||
manhole.py | ||
metrics.py | ||
module_loader.py | ||
msisdn.py | ||
patch_inline_callbacks.py | ||
ratelimitutils.py | ||
retryutils.py | ||
rlimit.py | ||
rust.py | ||
stringutils.py | ||
task_scheduler.py | ||
templates.py | ||
threepids.py | ||
wheel_timer.py |