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

remove empty streams after wal replay #4265

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Sep 2, 2021

Refactors stream removal into it's own function and removes empty streams after WAL replay completes in order to not interfere with tenant stream limits during rollout.

@owen-d owen-d requested a review from a team as a code owner September 2, 2021 22:51
@@ -220,9 +220,17 @@ func (r *ingesterRecoverer) Close() {

for _, inst := range r.ing.getInstances() {
inst.forAllStreams(context.Background(), func(s *stream) error {
s.chunkMtx.Lock()
defer s.chunkMtx.Unlock()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I traced through some of the paths that are taken by ConvertHead below but it branches out a little bit. I'm wondering if it would be safer to explicitly just lock and unlock around the conditional below rather than using defer?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Given that the new code also does a return, I guess weigh this against having to unlock in 2 places vs defer. six and one half dozen....

Copy link
Collaborator

@slim-bean slim-bean left a comment

Choose a reason for hiding this comment

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

LGTM

@owen-d owen-d merged commit 1c90b9c into grafana:main Sep 7, 2021
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.

None yet

2 participants