Skip to content
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

Blocking Queries on ACL resources and Config Entries Unblock Too Often #6530

Open
mkeeler opened this issue Sep 23, 2019 · 2 comments
Open
Labels
theme/api Relating to the HTTP API interface theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies theme/envoy/xds Related to Envoy support theme/performance Performance benchmarking or potential improvement type/bug Feature does not function as expected

Comments

@mkeeler
Copy link
Member

mkeeler commented Sep 23, 2019

Overview of the Issue

Internally our blocking query function uses the index reported in the QueryMeta struct to determine if the index is new enough to unblock and return the data back to the API caller.

All of the blocking queries issued within agent/consul/acl_endpoint.go and in agent/consul/config_endpoint.go set this index to be whatever value comes out of the "index" table for that type in memdb. This is done instead of setting it to the value of the max modify index of the data (for listings) or simple the modify index (for single object reads).

The ramifications of this are that we may unblock a query even when the underlying data we are looking at hasn't changed but other unrelated data has.

Real world implications are that our watches on config entries are likely to cause unnecessary churn through proxy configurations for Connect. There are likely other real world performance issues too.

@mkeeler mkeeler added type/bug Feature does not function as expected theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies theme/api-efficiency theme/performance Performance benchmarking or potential improvement theme/envoy/xds Related to Envoy support labels Sep 23, 2019
@mkeeler mkeeler added this to the 1.6.x milestone Sep 23, 2019
@mkeeler
Copy link
Member Author

mkeeler commented Sep 23, 2019

One thing to note is that if the blocking query is started before the tables index is updated then we may block waiting for the data to be updated. However when we are blocking waiting for a non-existent entry to be created this will not work as we will be woken up for every modification.

@pierresouchay
Copy link
Contributor

@mkeeler For the non-existent entries, you may use the same mechanics as the optimization used here: #4810 (which is not perfect if many services disappear/sec, but is globally at very good one still as "normal" updates not deleting a full service to not wake up watchers all the time).
In our case, it really decreased by quite a lot the load on Consul servers because of apps waiting for "unexistent" services (ex: prometheus)

@hanshasselberg hanshasselberg modified the milestones: 1.6.x, 1.7.x Jan 13, 2020
@jsosulska jsosulska added theme/api Relating to the HTTP API interface and removed theme/api-efficiency labels Apr 15, 2020
@mikemorris mikemorris removed this from the 1.7.x milestone Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/api Relating to the HTTP API interface theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies theme/envoy/xds Related to Envoy support theme/performance Performance benchmarking or potential improvement type/bug Feature does not function as expected
Projects
None yet
Development

No branches or pull requests

5 participants