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

AE: use stale requests when performing full sync #5873

Merged
merged 1 commit into from
Jun 17, 2019

Conversation

ShimmerGlass
Copy link
Contributor

Read requests performed during anti antropy full sync currently target
the leader only. This generates a non-negligible load on the leader when
the DC is large enough and can be offloaded to the followers following
the "eventually consistent" policy for the agent state.
We switch the AE read calls to use stale requests with a small (2s)
MaxStaleDuration value and make sure we do not read too fast after a
write.

Read requests performed during anti antropy full sync currently target
the leader only. This generates a non-negligible load on the leader when
the DC is large enough and can be offloaded to the followers following
the "eventually consistent" policy for the agent state.
We switch the AE read calls to use stale requests with a small (2s)
MaxStaleDuration value and make sure we do not read too fast after a
write.
Copy link
Contributor

@pierresouchay pierresouchay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reduces a bit the amount of leader-only RPC and is failry easy to integrate.

On a large cluster, ie: 8000 nodes, this accounts for 8000 / (7 * 60) ~ 20 qps only for anti-entropy when nothing happens (I am not talking about restart of agents).

Using it with stale would allow all reads to scale reads across all consul servers followers more easily. Since MaxStaleDuration is used, we are sure that a late follower will not break registration globally anyway.

Copy link
Member

@hanshasselberg hanshasselberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aestek thanks for your work, this looks nice! We were thinking to make that configurable but decided against it for now. We can add that later if necessary. Thanks again!

@hanshasselberg hanshasselberg merged commit 24a0f2b into hashicorp:master Jun 17, 2019
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.

3 participants