-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Possible glitch on ZFS on Linux #484
Comments
Relevant bit of strace:
It opens the file at size 2082, appends 1041 bytes so you'd expect the lseek(20, 0, SEEK_CUR) to return 2082+1041=3123 (which is what fstat returns) but instead it returns 1041. |
zfslib2 version is 0.6.3-2~precise, I'm on amd64. |
Per http://pubs.opengroup.org/onlinepubs/009695399/functions/lseek.html |
Are other Linux filesystems behaving differently? The specification suggests that this behavior is correct:
http://pubs.opengroup.org/onlinepubs/009695399/functions/lseek.html If other Linux filesystems (e.g. ext4) behave differently here, we will need to talk to their maintainers to compare notes on this discrepancy. |
I think you meant http://pubs.opengroup.org/onlinepubs/009695399/functions/write.html |
I did. Thanks for posting the correct link. That said, it seems that I misread. If my cursory reading of the spec is to be believed, we should be returning 2082, not 1041. |
Minimal test case: https://gist.github.com/brian-brazil/0022440426ea12728651 On zfs:
On ext4:
On tmpfs:
Linux mari 3.5.0-54-generic #81~precise1-Ubuntu SMP Tue Jul 15 04:02:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux |
sarnold in #zfsonlinux on freenode commented that the spec requires two updates. One is to update the file offset to the EOF before a FAPPEND write operation and another is the normal increment following the write operation. This is consistent with what you have observed on other filesystems. Something like this should fix this:
I will open a pull request later today after I have done proper testing. |
So it's not our fault. Cool. ;-) What's a good way to communicate this to Prometheus users on ZFS? Just leave this issue open? Or should we start a 'known issues' list somewhere? |
This sounds like something we should communicate to Go and ZFS users generally. |
Posted it to the G+ golang community. I'm not on go-nuts@ or any ZFS mailing list, though... |
ZFS devs have already chimed in, apparently working on a PR. So I On Wed, Jan 28, 2015 at 12:23 PM, Jakub Turski notifications@github.com wrote:
Björn Rabenstein, Engineer SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany |
Closes prometheus/prometheus#484 Signed-off-by: Richard Yao <ryao@gentoo.org>
@beorn7 Filing an issue in the with ZoL tracker would have been a nice reminder in case I had forgotten about this. Thankfully, I did not. A fix is in a pull request. |
Closes prometheus/prometheus#484 Signed-off-by: Richard Yao <ryao@gentoo.org>
Cool. Thanks @ryao . Prometheans, do we want to add an anticipated FAQ or something? |
It's now in the FAQ. Closing. |
Explain how we handle strings.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The os.File.Seek method doesn't seem to return the right result when used to find out about the file offset.
That breaks TestPersistLoadDropChunks, but it might also break things in the storage layer quite badly...
The text was updated successfully, but these errors were encountered: