-
Notifications
You must be signed in to change notification settings - Fork 15
Fix IO Stats computation #119
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 IO Stats computation #119
Conversation
53f09d7 to
3cb7cf7
Compare
abhinavdangeti
left a comment
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.
Looking ok I think.
intDecoder.go
Outdated
| rv.chunkOffsets[i], read = binary.Uvarint(buf[offset+n : offset+n+binary.MaxVarintLen64]) | ||
| n += uint64(read) | ||
| } | ||
|
|
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.
Undo the changes in this file, nothing related here.
|
And rebase over commit 7204400. |
09eb94a to
f603c7a
Compare
|
Rebased @Thejas-bhat 's changes over tip of |
An unaligned atomic bug was unfortunately introduced in #119 because the `bytesWritten` field was placed at the end of the `chunkedContentCoder` struct. This places this after the bytes.Buffers and the bool causing it to be misaligned. The ideal placement of this variable is not entirely clear but placing it before the progresiveWrite bool should help. An alternative would be to just place this atomic field at the top of the struct then there would be no risk of it becoming misaligned in future. I moved a few things around to reduce the size of the struct too but it could be possible to adjust things a little more to make the struct a little smaller. Signed-off-by: Andrew Thornton <[email protected]>
An unaligned atomic bug was unfortunately introduced in blevesearch#119 because the `bytesWritten` field was placed at the end of the `chunkedContentCoder` struct. This places this after the bytes.Buffers and the bool causing it to be misaligned. The ideal placement of this variable is not entirely clear but placing it before the progresiveWrite bool should help. An alternative would be to just place this atomic field at the top of the struct then there would be no risk of it becoming misaligned in future. I moved a few things around to reduce the size of the struct too but it could be possible to adjust things a little more to make the struct a little smaller. Signed-off-by: Andrew Thornton <[email protected]>
The newly introduced stats in the PR #1702 and #117
are currently computed all time the irrespective of whether or not its needed. Since it is in a fairly hot code path, it could affect the performance when these stats are not needed. Hence, this PR aims to hide those stats computation behind a flag which controls the same.