Skip to content

Cache slots info & Removing "master_nodes" module variable #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

shuxiao9058
Copy link

refer steve0511#86

also fix a potential bug caused with limit pool when tcp connect failed with too many waiting connect operations.

more details:

https://github.com/openresty/lua-nginx-module#tcpsockconnect

Alejandro Gonzalez and others added 10 commits July 8, 2021 19:11
* info in this table was not "per client" (like slot_cache) so it was containing a list of all master nodes of all cluster-clients ever instantiated
* list was always growing (there were just appends to the table)
* list of master nodes can be already obtained from the slots info already cached per client (this eliminates the need of an extra "nodes" query to redis)
…ker/timer context.

In this case ngx.req.start_time() always returns 0 and max_connection_timeout always triggers a timeout without even attempting a connection
…_fix

Fix for max_connection_timeout in worker/timer context
Previously, if a cached serv_list existed then these would be the only
servers consulted. However, it is possible that the config serv_list has
been updated which means any new addresses will not be considered.

In most scenarios this is not a problem - the cluster knows the current
active topology. But in the event that all nodes are suddenly lost (for
example, the entire cluster is brought up on new addresses), the cache
presumes itself to still be the source of truth.

This commit appends our configured serv_list to the cached list (if
present), and so if all cached servers fail, it will try from the
configured list.
…v-list-when-fetching-slots

Ensure configured serv_list is available when fetching slots
…t-refresh_slots

fix commit_pipeline connect err not refresh_slots,when it has auth
@shuxiao9058 shuxiao9058 force-pushed the cache_slots_info branch 2 times, most recently from 0227710 to 4729923 Compare February 25, 2022 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants