-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add max file size bootstrap check #25974
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
Conversation
This commit adds a bootstrap check for the maximum file size, and ensures the limit is set correctly when Elasticsearch is installed as a service on systemd-based systems.
|
Otherwise this can happen: |
| public static final int ENOMEM = 12; | ||
| public static final int RLIMIT_MEMLOCK = Constants.MAC_OS_X ? 6 : 8; | ||
| public static final int RLIMIT_AS = Constants.MAC_OS_X ? 5 : 9; | ||
| public static final int RLIMIT_FSIZE = Constants.MAC_OS_X ? 1 : 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the ternary operator looks useless?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer it this way because it's consistent with how the other RLIMIT constants are defined where there are differences between macOS and Linux.
|
|
||
| The segment files that are the components of individual shards and the translog | ||
| generations that are components of the translog can get large (on the order of | ||
| hundreds of megabytes and even extending into gigabytes). On systems where the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the phrasing ("even") suggests having files that are 1GB is uncommon, while I think it is actually common?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, that was not intended, I pushed ee35808.
| public void testSetMaxFileSize() throws IOException { | ||
| if (Constants.LINUX) { | ||
| final List<String> lines = Files.readAllLines(PathUtils.get("/proc/self/limits")); | ||
| if (!lines.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this if statement looks useless?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inside this block we make assertions and return from the method. Otherwise, there is a fail below this block that fails the test because we can not assert anything if for some reason we did not read any content from /proc/self/limits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the for loop will prevent from reaching the assertions and returning if lines is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I pushed 34a82d5.
|
test this please |
This commit adds a bootstrap check for the maximum file size, and ensures the limit is set correctly when Elasticsearch is installed as a service on systemd-based systems. Relates #25974
This commit adds a bootstrap check for the maximum file size, and ensures the limit is set correctly when Elasticsearch is installed as a service on systemd-based systems. Relates #25974
This commit adds a bootstrap check for the maximum file size, and ensures the limit is set correctly when Elasticsearch is installed as a service on systemd-based systems. Relates #25974
|
Thank you for the review @jpountz. |
This commit adds a bootstrap check for the maximum file size, and ensures the limit is set correctly when Elasticsearch is installed as a service on systemd-based systems.