Skip to content

Fix the storage corruption bug. - #880

Merged
beorn7 merged 2 commits into
masterfrom
beorn7/fix
Jul 16, 2015
Merged

beorn7 merged 2 commits into
masterfrom
beorn7/fix

Conversation

@beorn7

@beorn7 beorn7 commented Jul 6, 2015

Copy link
Copy Markdown
Contributor

@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.

Comment thread storage/local/chunk.go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@beorn7
beorn7 force-pushed the beorn7/fix branch 4 times, most recently from bcb0e4d to 8a3d354 Compare July 15, 2015 19:01
@beorn7 beorn7 changed the title [WIP] Fix the storage corruption bug. Fix the storage corruption bug. Jul 15, 2015
@beorn7

beorn7 commented Jul 15, 2015

Copy link
Copy Markdown
Contributor Author

@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.

@beorn7

beorn7 commented Jul 15, 2015

Copy link
Copy Markdown
Contributor Author

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.

beorn7 added 2 commits July 16, 2015 13:09
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.
@beorn7

beorn7 commented Jul 16, 2015

Copy link
Copy Markdown
Contributor Author

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...

@fabxc

fabxc commented Jul 16, 2015

Copy link
Copy Markdown
Contributor

👍

beorn7 added a commit that referenced this pull request Jul 16, 2015
Fix the storage corruption bug.
@beorn7
beorn7 merged commit c5d8730 into master Jul 16, 2015
@beorn7
beorn7 deleted the beorn7/fix branch July 16, 2015 13:55
zenador pushed a commit to zenador/prometheus that referenced this pull request Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants