-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Headblock interop #3995
Headblock interop #3995
Conversation
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 just added a minor suggestion irrelevant to your code.
The changes look good to me!
@@ -74,7 +88,7 @@ type MemChunk struct { | |||
cutBlockSize int | |||
|
|||
// Current in-mem block being appended to. | |||
head *headBlock | |||
head HeadBlock | |||
|
|||
// the chunk format default to v2 |
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.
While we are at it, If I am not wrong, we default to v3
now, and I think we should update this comment too?
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 think its not yet active since NewMemChunk
still creates an ordered head.
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 found the DefaultChunkFormat being set to v3
. Am I looking at the wrong place?
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 I missed it
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.
This is covered in the followup PR #4001 :)
} | ||
|
||
func (hb *unorderedHeadBlock) Reset() { | ||
x := newUnorderedHeadBlock() |
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.
Might be interesting instead to use https://github.com/golang-collections/go-datastructures/blob/59788d5eb259/rangetree/entries.go#L33 which will attemps to reuse entries.
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.
ooh great catch
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
This PR is the next one working towards enabling out of order writes in Loki. Notably, it
HeadBlock
interface type and ensures both ordered & unordered variants implement it.ref #1544