This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kolesnikovae
force-pushed
the
fix/head-init-lazily
branch
from
June 19, 2023 13:18
a6adc00
to
babdc32
Compare
kolesnikovae
force-pushed
the
fix/head-init-lazily
branch
from
June 19, 2023 13:53
babdc32
to
b2a5d07
Compare
kolesnikovae
changed the title
Lazily block head initialization
Lazy block head initialization
Jun 19, 2023
kolesnikovae
commented
Jun 19, 2023
Comment on lines
-850
to
-862
// Closes closes the head | ||
func (h *Head) Close() error { | ||
close(h.stopCh) | ||
|
||
var merr multierror.MultiError | ||
for _, t := range h.tables { | ||
merr.Add(t.Close()) | ||
} | ||
|
||
h.wg.Wait() | ||
return merr.Err() | ||
} | ||
|
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.
I removed the method because it is impossible to use it correctly:
Close
is supposed to be called afterFlush
, and tables are closed atFlush
, therefore the call always returns an error. It worked because we used to create an empty head right away after flush.- There is no case when head is just closed without flushing data.
cyriltovena
approved these changes
Jun 19, 2023
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.
LGTM
simonswine
pushed a commit
to simonswine/pyroscope
that referenced
this pull request
Jun 30, 2023
* Lazy block head initialization * Add test for flush channel * Fix lint issue
kolesnikovae
added
kind/bug
Something isn't working
kind/performance
area/database
labels
Jul 13, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See grafana/pyroscope#2047 for context. This change makes PhlareDB to initialise the head lazily at the first ingestion request.