fix: return a corruption error when chunk head out of sequence#7855
Conversation
571cf2a to
e4eb611
Compare
codesome
left a comment
There was a problem hiding this comment.
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.
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.
Ops... sorry, my brainfart :p
|
cc @roidelapluie, it would be nice to get this into 2.21 |
8747da7 to
207661f
Compare
…at is out of sequence Signed-off-by: sunyukun <sunyukun@didiglobal.com>
207661f to
95afbd3
Compare
No description provided.