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

fix(enterprise): improve user creation process #5917

Merged
merged 9 commits into from
May 16, 2022
Merged

Conversation

sranka
Copy link
Contributor

@sranka sranka commented May 11, 2022

Closes #5840

What was the problem?
Sometimes, when a multi-meta-node enterprise cluster has many users, the chronograf user creation process fails on user not found, the user is however created. This happens because of the eventual consistency of the meta-node cluster, the follower nodes (that are asked to get the user) might not be in sync yet with the leader node (that is always asked to create the user).

What was the solution?

  • remember the last redirect to the master meta node (performed when the user is created) and then stick the communication (getting the user, assigning permissions/roles) to the master node in order to avoid stale reads in an eventually consistent meta-nodes cluster
  • (wait for eventual consistency) wait for the user creation to be consistent across all meta nodes (at most for 2 seconds), re-check every 50ms
  • (optimize) do not update empty user permissions during user creation

@sranka sranka changed the title 5840/create user error fix(enterprise): repair user creation process May 11, 2022
@sranka sranka changed the title fix(enterprise): repair user creation process fix(enterprise): improve user creation process May 11, 2022
@sranka sranka marked this pull request as ready for review May 11, 2022 18:16
@sranka sranka added this to the 1.10 milestone May 12, 2022
@sranka sranka self-assigned this May 12, 2022
Copy link
Contributor

@vlastahajek vlastahajek left a comment

Choose a reason for hiding this comment

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

LGTM

@sranka sranka merged commit 399e370 into master May 16, 2022
@sranka sranka deleted the 5840/create_user_error branch May 16, 2022 12:02
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.

Adding InfluxDB user returns Error: Failed to create User: user not found
2 participants