bb2f958eb5
Since channels_redis does not support dedicated read-redis instances, the autoupdate message may be received before the data was replicated. All workers read the autoupdate message from the write host, so there is a race between getting this message and a finished replication. For large payloads, the replication is slower in the most cases (even more in a distributed setup, where the master and replica are on different nodes). The easy way is to wait for replication. But there is one difficulty: The number of replicas has to be known. There is a new settings-variable "AMOUNT_REPLICAS" which defaults to 1. It needs to be set correctly! If it is too high, every autoupdate will be delayed by 1 seconds because of a timeout witing for non-existent replicas. If it is too low, some autoupdates may be wrong (and not detectable by the client!) becuase of reading from non-synchronised relicas. The other possibility is to fork channel_redis and add the feature of a read-only redis. This ould help, because on a single redis instance all commands are ordered: First, the data is synced, then the autoupdate message. Attention: This means, if redis-replicas are scaled up, one must make sure to read from the same instance. I think this is not possible in the way how dockers overlay networks work. The only way would be to open one connection and reuse the connection from channels_redis in OpenSlides. This would mean a heavy integration of channels_redis (meaning including the source code in our repo). For the first fix, this one is easy and should work. |
||
---|---|---|
.. | ||
__init__.py | ||
access_permissions.py | ||
arguments.py | ||
auth.py | ||
autoupdate.py | ||
cache_providers.py | ||
cache.py | ||
constants.py | ||
consumers.py | ||
exceptions.py | ||
locking.py | ||
logging.py | ||
main.py | ||
manager.py | ||
middleware.py | ||
migrations.py | ||
models.py | ||
plugins.py | ||
projector.py | ||
redis_connection_pool.py | ||
redis.py | ||
rest_api.py | ||
schema_version.py | ||
settings.py.tpl | ||
startup.py | ||
stats.py | ||
utils.py | ||
validate.py | ||
views.py | ||
websocket.py |