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

Refactor SSD/FileStore logic out of NodeEnvironment #10755

Merged
merged 1 commit into from Apr 23, 2015

Conversation

rmuir
Copy link
Contributor

@rmuir rmuir commented Apr 23, 2015

This logic is rather hairy and nicer to be in its own place. It currently has to do things like "match" the result of Files.getFileStore with the "better" data found in FileSystem.getFileStores(), detect SSDs to set "spins", etc.

We can encapsulate a lot of the logic by just providing an "enhanced" filestore that takes care of the pain points. For example, exposes "spins" as an optional attribute so calling code doesn't have to worry about all the hairiness here.

Finally the current logic being in NodeEnvironment causes security challenges/complexity on #10717:

  • Iterating FileSystem.getFileStores() requires permissions to every mount point on the system.
  • SSD detection requires scary permissions for system and device files.

On the other hand, with this patch, asking for Files.getFileStore("/usr/foo") only requires read permission to "/usr/foo" itself, and "getFileStoreAttributes".

@rjernst
Copy link
Member

rjernst commented Apr 23, 2015

LGTM, I like tying the spins attribute into the filestore itself!

@mikemccand
Copy link
Contributor

LGTM

rmuir added a commit that referenced this pull request Apr 23, 2015
refactor SSD/FileStore logic out of NodeEnvironment
@rmuir rmuir merged commit 0513815 into elastic:master Apr 23, 2015
@rmuir rmuir mentioned this pull request Apr 23, 2015
@clintongormley clintongormley added >enhancement :Core/Infra/Core Core issues without another label labels Apr 26, 2015
@clintongormley clintongormley changed the title refactor SSD/FileStore logic out of NodeEnvironment Refactor SSD/FileStore logic out of NodeEnvironment Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >enhancement v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants