Add max file size bootstrap check#25974
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.
the ternary operator looks useless?
There was a problem hiding this comment.
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.
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.
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.
this if statement looks useless?
There was a problem hiding this comment.
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.
the for loop will prevent from reaching the assertions and returning if lines is empty?
|
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.