-
Notifications
You must be signed in to change notification settings - Fork 602
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 data corruption (shard.go) #119
Conversation
I pushed a commit on top which fixes a datarace in |
Before the fix in With the last fix, it passes Since I now do the read twice in |
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.
I really like the detailed test to make sure there are no cache corruptions, I think this PR is great. It could use a little bit more, but I'm onboard with this. :)
@@ -162,6 +162,11 @@ func (q *BytesQueue) Get(index int) ([]byte, error) { | |||
return data, err | |||
} | |||
|
|||
// CheckGet checks if an entry can be read from index | |||
func (q *BytesQueue) CheckGet(index int) error { |
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.
Please add a test for this.
@@ -177,6 +182,23 @@ func (e *queueError) Error() string { | |||
return e.message | |||
} | |||
|
|||
// peekCheckErr is identical to peek, but does not actually return any data | |||
func (q *BytesQueue) peekCheckErr(index int) error { |
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.
Also needs a test. :)
I addressed the concerns. |
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
So that's weird. I merged it in the UI, it didn't merge the branch, and then it just kicked off another travis build, but then travis errored out: $HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service travis-ci
Bad response status from coveralls: 422
{"message":"Couldn't find a repository matching this job.","error":true}
The command "$HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service travis-ci" exited with 1. @cristaloleg can you take a look when you get a chance? |
Thank you @holiman |
This PR contains a testcase which demonstrates corruption (intermittently). Sometimes leading to `panic`, and sometimes leading to data corruption of values. I thought that fixing the datarace suggested in allegro#117 would solve it, but it seems I was wrong about that, there's some other underlying bug. I'll push a commit on top if I find it.
This PR contains a testcase which demonstrates corruption (intermittently). Sometimes leading to `panic`, and sometimes leading to data corruption of values. I thought that fixing the datarace suggested in allegro#117 would solve it, but it seems I was wrong about that, there's some other underlying bug. I'll push a commit on top if I find it.
This PR contains a testcase which demonstrates corruption (intermittently). Sometimes leading to
panic
, and sometimes leading to data corruption of values.I thought that fixing the datarace suggested in #117 would solve it, but it seems I was wrong about that, there's some other underlying bug. I'll push a commit on top if I find it.