Skip to content
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

Calling ReadAll on wal with empty file will return 'invalid argument' #8045

Closed
andersjohnsen opened this issue Jun 7, 2017 · 0 comments
Closed

Comments

@andersjohnsen
Copy link

This is happening as the WAL is trying to zero-extend the file by 0 bytes. On unix (linux 4.4.0 in my case, this returns an invalid argument error if the size 0 is given.

From: http://man7.org/linux/man-pages/man2/fallocate.2.html

   EINVAL offset was less than 0, or len was less than or equal to 0.

I suggest Preallocate is change to return early if sizeInBytes is 0.

heyitsanthony pushed a commit to heyitsanthony/etcd that referenced this issue Jun 7, 2017
fallocate will return EINVAL, causing zeroing to the end of a
0 byte file to fail.

Fixes etcd-io#8045
heyitsanthony pushed a commit to heyitsanthony/etcd that referenced this issue Jun 7, 2017
fallocate will return EINVAL, causing zeroing to the end of a
0 byte file to fail.

Fixes etcd-io#8045
gyuho pushed a commit that referenced this issue Jun 7, 2017
fallocate will return EINVAL, causing zeroing to the end of a
0 byte file to fail.

Fixes #8045
yudai pushed a commit to yudai/etcd that referenced this issue Oct 5, 2017
fallocate will return EINVAL, causing zeroing to the end of a
0 byte file to fail.

Fixes etcd-io#8045
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant