-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Do not run sysctl
for vm.max_map_count
when its already set
#31285
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
Do not run sysctl
for vm.max_map_count
when its already set
#31285
Conversation
I don't think this is needed. Rather, I think that you can mask |
Pinging @elastic/es-core-infra |
@jasontedor This is for a
|
Oh, I missed that; sorry. Would you add a packaging test for this please? See for example: elasticsearch/qa/vagrant/src/test/resources/packaging/tests/60_systemd.bats Lines 214 to 221 in 0bfd18c
and check the contributing docs for how to run these tests. You can also push such a change to the PR and we can run the tests in our CI, but that might be painful to iterate on. Effectively we would want a test here that shows that if the |
Ya I can take a stab at it, I see two options regarding testing:
|
Thank you for this PR, and thank you for agreeing to try contributing a test. I think that a test along the lines of what you describe in option one is good. I do think that there should be a test though for when the current value already exceeds what we set it to since the point of your change is that we do not do anything in that case? |
That makes sense, I will try look through it and figure out what's the easiest way to test that depending on distribution. If you happen to know if there is some helper function that would allow me to specify it in an distribution agnostic method that would save me some trouble. I will work on the first test as its easier and demonstrates this is not a breaking change and will then work on the test to ensure that it does what I expect. |
It is okay; I think you can call |
@jasontedor any chance you can give me your username in IRC so I can hit you up? If you prefer to hit me up I a share my github and irc username. I am having difficulty getting all the dependencies in place locally. While I could just push and have you run it on your CI I'd rather learn to fish. |
ce8a670
to
5c95fe7
Compare
@majormoses I appreciate your dedication here. I would be happy to help yet it’s quite late in my timezone. Could we pick this up tomorrow? If you send to me an email at my first name at elastic.co we can connect. |
8ebcfc7
to
73c50fc
Compare
elastic bot: run all packaging tests |
I am working on trying to get them running locally but the failure seems to be a timeout rather than a failed spec.
|
c8898d5
to
c51f136
Compare
…e same or greater value. Context: This fails in a docker container otherwise. Signed-off-by: Ben Abrams <[email protected]>
c51f136
to
9d82a67
Compare
I got the tests working locally:
I will create a gist and link it here. |
elastic bot: run all packaging tests Not sure if its open to the public but it was worth a try. |
It is not otherwise that would be a vehicle for remote code execution on our infrastructure. |
makes sense, if it was ephemeral it probably would not matter beyond people using it to do something like spinning up crypto miners but better to be safe than sorry. |
@elasticmachine test this please |
* elastic/master: (29 commits) [DOC] Extend SQL docs Immediately flush channel after writing to buffer (elastic#31301) [DOCS] Shortens ML API intros Use quotes in the call invocation (elastic#31249) move security ingest processors to a sub ingest directory (elastic#31306) Add 5.6.11 version constant. Fix version detection. SQL: Whitelist SQL utility class for better scripting (elastic#30681) [Docs] All Rollup docs experimental, agg limitations, clarify DeleteJob (elastic#31299) CCS: don't proxy requests for already connected node (elastic#31273) Mute ScriptedMetricAggregatorTests testSelfReferencingAggStateAfterMap [test] opensuse packaging turn up debug logging Add unreleased version 6.3.1 Removes experimental tag from scripted_metric aggregation (elastic#31298) [Rollup] Metric config parser must use builder so validation runs (elastic#31159) [ML] Check licence when datafeeds use cross cluster search (elastic#31247) Add notion of internal index settings (elastic#31286) Test: Remove broken yml test feature (elastic#31255) REST hl client: cluster health to default to cluster level (elastic#31268) [ML] Update test thresholds to account for changes to memory control (elastic#31289) ...
@elasticmachine test this please |
I merged master into your branch and started a new build because the current one was not going to succeed on the BWC aspect of the build given that we bumped versions a few hours ago. |
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 looks good and the tests look good; thanks so much for writing them and getting them working. 💯
I left one comment.
max_map_count=$(sysctl -n vm.max_map_count) | ||
stop_elasticsearch_service | ||
|
||
[ $max_map_count != 100 ] |
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 would be okay with us asserting that this is 262144
.
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 personally do not think it would be better as if the defaults change this is one more test to update and if its not 100
and the previous command did not error (which I assume would trigger a failed build) it should essentially be the same but if you feel otherwise I can certainly change it.
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.
Well, today we want to ensure that the value is set to what we specify: 262144. It's not much overhead to have to change this if we were to make a change to the default here.
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.
k, will update.
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.
updated
* elastic/master: More detailed tracing when writing metadata (elastic#31319) [Tests] Mutualize fixtures code in BaseHttpFixture (elastic#31210) Remove RestGetAllAliasesAction (elastic#31308) Temporary fix for broken build Reenable Checkstyle's unused import rule (elastic#31270) Remove remaining unused imports before merging elastic#31270 Fix non-REST doc snippet
@elasticmachine test this please |
Signed-off-by: Ben Abrams <[email protected]>
@elasticmachine test this please |
@elasticmachine run all packaging tests |
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.
LGTM.
This commit modifies the Sys V init startup scripts to only modify vm.max_map_count if needed. In this case, needed means that the current value is less than our default value of 262144 maps.
This commit modifies the Sys V init startup scripts to only modify vm.max_map_count if needed. In this case, needed means that the current value is less than our default value of 262144 maps.
This commit modifies the Sys V init startup scripts to only modify vm.max_map_count if needed. In this case, needed means that the current value is less than our default value of 262144 maps.
Thanks @majormoses. |
* master: 992c788 Uncouple persistent task state and status (#31031) 8c6ee7d Describe how to add a plugin in Dockerfile (#31340) 1c5cec0 Remove http status code maps (#31350) 87a676e Do not set vm.max_map_count when unnecessary (#31285) e5b7137 TEST: getCapturedRequestsAndClear should be atomic (#31312) 0324103 Painless: Fix bug for static method calls on interfaces (#31348) d6d0727 QA: Fix resolution of default distribution (#31351) fcf1e41 Extract common http logic to server (#31311) 6dd81ea Build: Fix the license in the pom zip and tar (#31336) 8f886cd Treat ack timeout more like a publish timeout (#31303) 9b29327 [ML] Add description to ML filters (#31330) f7a0caf SQL: Fix build on Java 10 375d09c [TEST] Fix RemoteClusterClientTests#testEnsureWeReconnect 4877cec More detailed tracing when writing metadata (#31319) bbfe1ec [Tests] Mutualize fixtures code in BaseHttpFixture (#31210)
* 6.x: 6d711fa (origin/6.x, 6.x) Uncouple persistent task state and status (#31031) f0f16b7 [TEST] Make SSL restrictions update atomic (#31050) 652193f Describe how to add a plugin in Dockerfile (#31340) bb568ab TEST: getCapturedRequestsAndClear should be atomic (#31312) 6f94914 Do not set vm.max_map_count when unnecessary (#31285) c12f3c7 Painless: Fix bug for static method calls on interfaces (#31348) 21128e2 QA: Fix resolution of default distribution (#31351) df17a83 Build: Fix the license in the pom zip and tar (#31336) 3e76b15 Treat ack timeout more like a publish timeout (#31303)
Context: This fails in a docker container otherwise. The change was inspired by issues getting it working and after researching I found a similar change applied to another project: spujadas/elk-docker#106 the major difference here is that we include equality in the condition rather than only if its greater than.
This was the error I encountered:
After applying the patch I was able to see that error go away (other errors still but one at a time):
Signed-off-by: Ben Abrams [email protected]