-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
fix: return a corruption error when chunk head out of sequence #7855
fix: return a corruption error when chunk head out of sequence #7855
Conversation
571cf2a
to
e4eb611
Compare
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 for the PR. Can you brief about what you are trying to do exactly? Because what you mentioned in the title of the PR would not fix the the linked issues. (and out of sequence files is not a data corruption)
e4eb611
to
8747da7
Compare
Also, this PR gave me a hint why #7753 was happening, thanks! When we error out in |
I have updated the PR description to exclude #5617 as that is unrelated to m-mapping |
@codesome Hi, yesterday I meet some problem. The log tolds me that it meet some expection on loading head chunk with ref
It seems that this chunk have an unexpected Every compact trying after then will failed. Even restart won't help, because this chunk is "cannot handle" and won't be removed. Data will become unvisible 2h by 2h.
I'm not sure, but I believe this chunk is corrupted. And I think an iterator function should be able to return an corruptionErr to let the caller know that this chunk have a bad metadata and should be removed. |
Hm, true, its better to delete m-mapped chunks from that point.
We should also take care of this |
tsdb/chunks/head_chunks.go
Outdated
Dir: cdm.dir.Name(), | ||
FileIndex: segID, | ||
} | ||
if err := f(seriesRef, chunkRef, mint, maxt, numSamples, chunkErrTpl); err != nil { |
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.
We should be just wrapping this error with corruption error and return and nothing else. You don't need additional argument for f
.
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.
Ops... sorry, my brainfart :p
cc @roidelapluie, it would be nice to get this into 2.21 |
8747da7
to
207661f
Compare
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! Thanks
…at is out of sequence Signed-off-by: sunyukun <sunyukun@didiglobal.com>
207661f
to
95afbd3
Compare
No description provided.