OpenSlides/openslides/utils
FinnStutzenstein bb2f958eb5 Redis: Wait for replication on writes
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.
2020-04-01 13:09:48 +02:00
..
__init__.py Add code 2011-07-31 10:46:29 +02:00
access_permissions.py number poll candidates depending on setting 2020-03-17 07:24:40 +01:00
arguments.py use f-string syntax for strings 2019-01-18 17:37:36 +01:00
auth.py added vote per user table and progress for polls 2020-03-17 07:24:39 +01:00
autoupdate.py Fix assignment access permissions 2020-03-17 07:24:37 +01:00
cache.py added count query decorator 2020-03-17 07:24:35 +01:00
cache_providers.py Redis: Wait for replication on writes 2020-04-01 13:09:48 +02:00
constants.py saml 2019-10-21 13:34:01 +02:00
consumers.py disable caching for reverse relations 2020-03-17 07:24:39 +01:00
exceptions.py Use python3 2014-08-24 21:21:11 +02:00
locking.py Adding a second optional redis for read only accesses 2019-12-03 12:30:31 +01:00
logging.py Logging prefix and handling redis connection errors 2019-09-02 08:09:28 +02:00
main.py activate start command 2019-01-20 11:24:42 +01:00
manager.py generate less queries in the autoupdate system 2020-03-17 07:24:36 +01:00
middleware.py Major cache rewrite: 2019-08-08 08:35:02 +02:00
migrations.py Fix 'errors' 2019-01-30 12:18:59 +01:00
models.py Prevent stopping an analog poll 2020-03-17 07:24:37 +01:00
plugins.py Run black 2019-01-08 21:51:52 +01:00
projector.py added chart projection for polls 2020-03-17 07:24:45 +01:00
redis.py Redis: Wait for replication on writes 2020-04-01 13:09:48 +02:00
redis_connection_pool.py Adding a second optional redis for read only accesses 2019-12-03 12:30:31 +01:00
rest_api.py Major cache rewrite: 2019-08-08 08:35:02 +02:00
schema_version.py Logging prefix and handling redis connection errors 2019-09-02 08:09:28 +02:00
settings.py.tpl Redis: Wait for replication on writes 2020-04-01 13:09:48 +02:00
startup.py saml 2019-10-21 13:34:01 +02:00
stats.py Logging prefix and handling redis connection errors 2019-09-02 08:09:28 +02:00
utils.py Fix assignment access permissions 2020-03-17 07:24:37 +01:00
validate.py Added html validation for users and personal notes 2019-11-08 15:39:18 +01:00
views.py Added config for more verbose errors on reset password 2019-09-03 14:47:45 +02:00
websocket.py Fixes python3.7 tests 2019-10-29 15:05:52 +01:00