villebro opened a new pull request, #45402: URL: https://github.com/apache/superset/pull/45402
### SUMMARY When `DISTRIBUTED_COORDINATION_CONFIG` uses `RedisSentinelCache`, `RedisSentinelCacheBackend` runs all coordination commands (GTF state, locks) through the connection returned by `Sentinel.master_for(...)`. That connection was built without `db` or `username`: `db` was only passed to the flask-caching parent constructor, whose clients the coordination mixin does not use, and `from_config` never read `CACHE_REDIS_USER`. As a result, coordination keys landed in DB 0 regardless of `CACHE_REDIS_DB`, and an ACL username could not be used. Pub/sub was unaffected since it is not scoped by DB. This passes `db` to `master_for`, adds a `username` parameter forwarded when set, and reads `CACHE_REDIS_USER` in `RedisSentinelCacheBackend.from_config`, mirroring `RedisCacheBackend.from_config`. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A ### TESTING INSTRUCTIONS Run `pytest tests/unit_tests/coordination/test_cache_backend.py`. The new test asserts that `from_config` with `CACHE_REDIS_DB=7` and `CACHE_REDIS_USER="u"` produces a master connection with `db=7` and `username="u"`. For manual verification, point coordination at a Sentinel deployment with `CACHE_REDIS_DB=7` and confirm coordination keys appear in DB 7, and that an ACL user restricted to DB 7 keys works. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
