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

[7.16] Add Windows native method to retrieve the number of allocated bytes on disk for file (#79698) #80427

Merged
merged 3 commits into from
Nov 5, 2021

Conversation

tlrx
Copy link
Member

@tlrx tlrx commented Nov 5, 2021

Backports the following commits to 7.16:

…n disk for file (elastic#79698)

In elastic#79371 we fixed a bug where cache files were not created 
as sparse files on Windows platforms because the wrong 
options were used when creating the files for the first time. 
This bug got unnoticed as we were lacking a way to retrieve 
the exact number of bytes allocated for a given file on disk.

This commit adds a FileSystemNatives.allocatedSizeInBytes(Path) 
method for that exact purpose (only implemented for Windows 
for now) and a test in CacheFileTests that would fail on 
Windows if the cache file is not sparse.

Relates elastic#79371
@tlrx tlrx added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport labels Nov 5, 2021
@tlrx tlrx added the test-windows Trigger CI checks on Windows label Nov 5, 2021
@tlrx
Copy link
Member Author

tlrx commented Nov 5, 2021

@elasticmachine retest this please

@tlrx tlrx added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) and removed auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Nov 5, 2021
@tlrx
Copy link
Member Author

tlrx commented Nov 5, 2021

@elasticmachine update branch

@tlrx tlrx removed the test-windows Trigger CI checks on Windows label Nov 5, 2021
@tlrx
Copy link
Member Author

tlrx commented Nov 5, 2021

@elasticmachine update branch

@elasticsearchmachine elasticsearchmachine merged commit 84c58db into elastic:7.16 Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport v7.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants