fix(limit-count): redis-sentinel keepalive pools must not be shared across database/credentials#13553
Open
nic-6443 wants to merge 1 commit into
Open
fix(limit-count): redis-sentinel keepalive pools must not be shared across database/credentials#13553nic-6443 wants to merge 1 commit into
nic-6443 wants to merge 1 commit into
Conversation
…and credentials Bump api7-lua-resty-redis-connector to 0.13.0: the connector skips AUTH/SELECT on connections reused from the pool, so the default host:port pool cross-contaminates configs with different databases or credentials, the sentinel-mode counterpart of the plain-redis fix. 0.13.0 derives the default pool name from the resolved address, database, credentials digest and TLS options. Also flush the sentinel master in the test helper so its counters do not survive CI re-runs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #13454
Sentinel-mode counterpart of #13516. The
redis-sentinelpolicy goes through api7-lua-resty-redis-connector, which skips AUTH/SELECT on connections reused from the keepalive pool while pooling by the defaulthost:portkey — so two routes pointing at the same sentinel-managed master with differentredis_databaseor credentials cross-contaminate exactly like the plain-redis case: limit counters land in the wrong database.This bumps the connector to 0.13.0 (api7/lua-resty-redis-connector#9), which derives the default pool name from everything the connection gets bound to at handshake time — resolved address, database, a credentials digest, and TLS options — while an explicit
connection_options.poolstill wins. Building the name from the resolved address keeps failover correct: a new master gets a new pool instead of reusing connections to the old one.The regression test mirrors the plain-redis one: two routes on the same sentinel master with
redis_database1 and 2 must keep their counters in their own databases. Without the bump it fails with both keys landing in db 1. The test helper now also flushes the sentinel master (port 6479) so counters don't survive CI re-runs.Checklist