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

receive: memoize exemplar/TSDB clients #7782

Merged
merged 1 commit into from
Sep 25, 2024
Merged

Conversation

GiedriusS
Copy link
Member

We call this on each Series() so memoize the creation of this slice.

@GiedriusS GiedriusS force-pushed the memoize_exemplar_tsdb_clients branch from 46df56c to 8436179 Compare September 25, 2024 10:23
@GiedriusS GiedriusS marked this pull request as ready for review September 25, 2024 10:26
We call this on each Series() so memoize the creation of this slice.

Signed-off-by: Giedrius Statkevičius <[email protected]>
@GiedriusS GiedriusS force-pushed the memoize_exemplar_tsdb_clients branch from 8436179 to 4024931 Compare September 25, 2024 10:30
@GiedriusS GiedriusS merged commit 90215ad into main Sep 25, 2024
22 checks passed
@GiedriusS GiedriusS deleted the memoize_exemplar_tsdb_clients branch September 25, 2024 11:23
jnyi pushed a commit to jnyi/thanos that referenced this pull request Oct 17, 2024
We call this on each Series() so memoize the creation of this slice.

Signed-off-by: Giedrius Statkevičius <[email protected]>
@jnyi
Copy link
Contributor

jnyi commented Nov 23, 2024

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

Comment on lines +615 to +618
if !t.tsdbClientsNeedUpdate {
return t.tsdbClients
}
defer t.mtx.Unlock()

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

Copy link
Member Author

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Already fixed here c10b695

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants