Repository navigation
Fix the storage corruption bug. - #880
Conversation
There was a problem hiding this comment.
Side note: So this is just about newly created chunks, right?
Is there any remotely valid reason why one would choose the old encoding, i.e. virtually no compression?
There was a problem hiding this comment.
First of all, this is obviously totally not related to this PR. I only added the doc comment here because somebody (I guess a @fabxc ) forgot to add it previously.
We had that discussion when we introduced the flag. (Single) delta encoding is not "virtually no compression". It could even work better than double-delta encoding, given the right data set. The reason to have a flag is to create backwards-compatible series files if desired. Also, if data is completely random, there will be no compression anyway, but double-delta encoding is slower than delta encoding.
bcb0e4d to
8a3d354
Compare
|
@fabxc This is now ready for review. Note that it is based on top of #889 , so look at the diff between the two branches or wait for #889 to get merged first. Note that the test added in commit 5125204aa3488b5239eb69768b37436f6e685d15 exposes the bug and is fixed by commit 8a3d3549cb18205de7478c10b1d23b21b7734f52. |
|
NB: The two commits referred to above are in the correct order: First the test to expose the bug, then the fix. GH is displaying it wrong. |
If all samples in consecutive chunks have the same timestamp, the way we used to load chunks will fail. With this change, the persist watermark is used to load the right amount of chunkDescs from disk. This bug is a possible reason for the rare storage corruption we have observed.
|
OK, so restructured everything as discussed. Now the test doesn't expose the old bug anymore because the timestamp monotonicity will avoid tickling the bug. Still, loading chunkDescs based on offset is simpler, faster, and more robust. Let's get this in and check if the storage corruption bug has been resolved by the combination of all of that... |
|
👍 |
Fix the storage corruption bug.
…ometheus Sync upstream at ab1b1db
@fabxc @juliusv Preview of a bugfix. I don't know if it fixes the bug. I'm playing with it right now.
This should not be merged right now. I have to remove the debug logging and add testing.