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

Relax restrictions on filesystem size reporting in DiskUsage #9283

Merged
merged 1 commit into from Jan 26, 2015

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Jan 13, 2015

Apparently some filesystems such as ZFS and occasionally NTFS can report
filesystem usages that are negative, or above the maximum total size of
the filesystem. This relaxes the constraints on DiskUsage so that an
exception is not thrown.

If 0 is passed as the totalBytes, 1 is used to avoid a division-by-zero
error.

Fixes #9249
Relates to #9260

@dakrone
Copy link
Member Author

dakrone commented Jan 21, 2015

@bleskes I changed this based on our conversation, I think for now the best thing is to not change any of the settings, and program around the divide-by-zero for percentages.

I think logging the invalid values will move to #8686

@bleskes bleskes self-assigned this Jan 23, 2015
@@ -31,20 +31,30 @@
final long totalBytes;
final long freeBytes;

/**
* Create a new DiskUsage, if {@code totalBytes} is 0, 1 is used to avoid
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is no longer true?

@bleskes
Copy link
Contributor

bleskes commented Jan 26, 2015

LGTM. Left some cosmetic comments , mostly around comments to explain the edge cases this covers.

Apparently some filesystems such as ZFS and occasionally NTFS can report
filesystem usages that are negative, or above the maximum total size of
the filesystem. This relaxes the constraints on `DiskUsage` so that an
exception is not thrown.

If 0 is passed as the totalBytes, `.getFreeDiskAsPercentage()` will
always return 100.0% free (to ensure the disk threshold decider fails
open)

Fixes elastic#9249
Relates to elastic#9260
@dakrone dakrone merged commit 537769c into elastic:master Jan 26, 2015
@clintongormley clintongormley changed the title Relax restrictions on filesystem size reporting in DiskUsage Stats: Relax restrictions on filesystem size reporting in DiskUsage Feb 10, 2015
@clintongormley clintongormley added :Data Management/Stats Statistics tracking and retrieval APIs and removed review labels Mar 19, 2015
@dakrone dakrone deleted the fix-9260 branch April 6, 2015 17:50
@clintongormley clintongormley changed the title Stats: Relax restrictions on filesystem size reporting in DiskUsage Relax restrictions on filesystem size reporting in DiskUsage Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elastic search 1.4.2 data path issue
3 participants