-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
receive: memoize exemplar/TSDB clients #7782
Conversation
46df56c
to
8436179
Compare
We call this on each Series() so memoize the creation of this slice. Signed-off-by: Giedrius Statkevičius <[email protected]>
8436179
to
4024931
Compare
We call this on each Series() so memoize the creation of this slice. Signed-off-by: Giedrius Statkevičius <[email protected]>
this pr introduced a bug when multiple tenants are created at the same time, only partial tenants would be memorized due to atomicity issue with the bool flag and where the slice gets updated, fyi @GiedriusS we plan to revert this pr internally but worth taking a look, it prevents new tenants to be queriable but luckily no data loss after restart the server |
if !t.tsdbClientsNeedUpdate { | ||
return t.tsdbClients | ||
} | ||
defer t.mtx.Unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defer t.mtx.Unlock()
should be before if
. @jnyi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks; care opening up a PR with the fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already fixed here c10b695
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, we found a different bug, I submit a PR to fix it, please take a look when you have time: #7941
We call this on each Series() so memoize the creation of this slice.