Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Make sure WAL Repair can handle wrapped errors #389

Merged
merged 1 commit into from
Sep 19, 2018

Conversation

gouthamve
Copy link
Collaborator

wal/wal.go Outdated
@@ -261,6 +261,8 @@ func (w *WAL) Repair(err error) error {
// But that's not generally applicable if the records have any kind of causality.
// Maybe as an extra mode in the future if mid-WAL corruptions become
// a frequent concern.
err = errors.Cause(err) // So that we can pick up errors even if wrapped.

cerr, ok := err.(*CorruptionErr)
if !ok {
return errors.New("cannot handle error")
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably show the original error as well, i.e. errors.Wrap(origErr, "cannot handle error")

@gouthamve
Copy link
Collaborator Author

@fabxc Yep, that would have made it easier to debug. Done.

@fabxc fabxc merged commit dfcb7d0 into prometheus-junkyard:master Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants