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

Access token mongodb service creates index excessively #15012

Closed
kroepke opened this issue Mar 22, 2023 · 0 comments · Fixed by #15097
Closed

Access token mongodb service creates index excessively #15012

kroepke opened this issue Mar 22, 2023 · 0 comments · Fixed by #15097
Assignees

Comments

@kroepke
Copy link
Member

kroepke commented Mar 22, 2023

Expected Behavior

The database index should only be created once, to ensure there's a unique index on the collection.

Current Behavior

Every time a token is a saved, including when its access time is updated, the index gets recreated.
This leads to at least an additional table lock, and extra work on index creation in the background. On systems with lots of sidecars this creates performance problems.

Possible Solution

In https://github.com/Graylog2/graylog2-server/blob/master/graylog2-server/src/main/java/org/graylog2/security/AccessTokenServiceImpl.java#L142 move the createIndex call to the constructor.

Steps to Reproduce (for bugs)

Code pointer above.

Context

Each access token use will save it to the database, leading to excessive queries.

Your Environment

  • Graylog Version: reported in 4.3 but applicable to all versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants