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

Backport of perf: Remove expensive reflection from raft/mesh hot path into release/1.15.x #17493

Conversation

hc-github-team-consul-core
Copy link
Contributor

Backport

This PR is auto-generated from #16552 to be assessed for backporting due to the inclusion of the label backport/1.15.

The below text is copied from the body of the original PR.


Description

Replaces a reflection-based copy of a struct in the mesh topology with a deep-copy generated implementation.

This is in the hot-path of raft FSM updates, and the reflection overhead was a substantial part of mesh registration times (~90%). This could manifest as raft thread saturation, and resulting instability.

This is a similar problem/fix as #14934, it might be worth seeing if there are any other uses of the reflection copy library and replacing it with (generated) copies.

Fixes #16551

Testing & Reproduction steps

Details in issue #16551 . The before/after from the test case in that issue:

Screenshot 2023-03-07 at 11 35 23

After the change was rolled out, we no longer saw any registration delays and the general raft/FSM thread saturation dropped off substantially

image

PR Checklist

  • updated test coverage
  • external facing docs updated
  • not a security concern

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/lstoll-deepcopy-upstreamdownstream/eminently-sweet-alpaca branch from 6cec5ce to 1fdf2ef Compare May 26, 2023 17:42
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/lstoll-deepcopy-upstreamdownstream/eminently-sweet-alpaca branch from ed12aaa to e733fa0 Compare May 26, 2023 17:42
Copy link

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

@vercel vercel bot temporarily deployed to Preview – consul-ui-staging May 26, 2023 17:47 Inactive
@vercel vercel bot temporarily deployed to Preview – consul May 26, 2023 17:47 Inactive
@hc-github-team-consul-core hc-github-team-consul-core merged commit d60e96f into release/1.15.x May 26, 2023
@hc-github-team-consul-core hc-github-team-consul-core deleted the backport/lstoll-deepcopy-upstreamdownstream/eminently-sweet-alpaca branch May 26, 2023 18:04
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