Description
The PR #724 added celery worker support using Redis following the standard Superset example: https://superset.apache.org/admin-docs/configuration/async-queries-celery/
- This only works for
RedisCache not RedisSentinelCache
- The schema used is always
redis:// instead of sentinel://
- The master-name cannot be configured for sentinel nodes
So Redis in HA mode is not available without overrides (not tested).
Possible untested fix
configOverrides:
superset_config.py:
FILE_FOOTER: |
from flask_caching.backends.rediscache import RedisSentinelCache
_SENTINELS = [("redis-sentinel-0.redis-sentinel-headless", 26379),
("redis-sentinel-1.redis-sentinel-headless", 26379),
("redis-sentinel-2.redis-sentinel-headless", 26379)]
_MASTER = "mymaster"
_PW = os.environ["CELERY_RESULTS_BACKEND_DATABASE_PASSWORD"]
RESULTS_BACKEND = RedisSentinelCache(
sentinels=_SENTINELS, master=_MASTER, password=_PW, db=0,
key_prefix="superset_results",
# sentinel_password=..., only if the sentinels themselves require auth
)
_URL = ";".join(f"sentinel://:{_PW}@{h}:{p}" for h, p in _SENTINELS) + "/0"
class CeleryConfig(object):
broker_url = _URL
result_backend = _URL
broker_transport_options = {"master_name": _MASTER}
result_backend_transport_options = {"master_name": _MASTER}
imports = ("superset.sql_lab", "superset.tasks.scheduler")
worker_prefetch_multiplier = 10
task_acks_late = True
task_annotations = {"sql_lab.get_sql_results": {"rate_limit": "100/s"}}
CELERY_CONFIG = CeleryConfig
This is just a workaround and will need adaptation whenever the redis replicas change.
Issue checklist
This is a simple checklist of things to bear in mind when creating a new issue.
Description
The PR #724 added celery worker support using Redis following the standard Superset example: https://superset.apache.org/admin-docs/configuration/async-queries-celery/
RedisCachenotRedisSentinelCacheredis://instead ofsentinel://So Redis in HA mode is not available without overrides (not tested).
Possible untested fix
This is just a workaround and will need adaptation whenever the redis replicas change.
Issue checklist
This is a simple checklist of things to bear in mind when creating a new issue.