Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPossible glitch on ZFS on Linux #484
Comments
beorn7
added
bug
labels
Jan 27, 2015
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
zfslib2 version is 0.6.3-2~precise, I'm on amd64. |
This comment has been minimized.
This comment has been minimized.
|
Per http://pubs.opengroup.org/onlinepubs/009695399/functions/lseek.html |
This comment has been minimized.
This comment has been minimized.
ryao
commented
Jan 28, 2015
|
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. |
This comment has been minimized.
This comment has been minimized.
|
I think you meant http://pubs.opengroup.org/onlinepubs/009695399/functions/write.html |
This comment has been minimized.
This comment has been minimized.
ryao
commented
Jan 28, 2015
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
ryao
commented
Jan 28, 2015
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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 comment has been minimized.
This comment has been minimized.
|
This sounds like something we should communicate to Go and ZFS users generally. |
This comment has been minimized.
This comment has been minimized.
|
Posted it to the G+ golang community. I'm not on go-nuts@ or any ZFS mailing list, though... |
This comment has been minimized.
This comment has been minimized.
|
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 |
ryao
added a commit
to ryao/zfs
that referenced
this issue
Jan 29, 2015
ryao
referenced this issue
Jan 29, 2015
Closed
Writes to file handles with FAPPEND should seek to end of write #3053
This comment has been minimized.
This comment has been minimized.
ryao
commented
Jan 29, 2015
|
@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. |
ryao
added a commit
to ryao/zfs
that referenced
this issue
Jan 29, 2015
This comment has been minimized.
This comment has been minimized.
|
Cool. Thanks @ryao . Prometheans, do we want to add an anticipated FAQ or something? |
This comment has been minimized.
This comment has been minimized.
|
It's now in the FAQ. Closing. |
beorn7
closed this
Feb 2, 2015
simonpasquier
pushed a commit
to simonpasquier/prometheus
that referenced
this issue
Oct 12, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
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. |
beorn7 commentedJan 27, 2015
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...