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

Fix windows memory locking #111866

Merged
merged 6 commits into from
Aug 15, 2024
Merged

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Aug 14, 2024

Memory locking on Windows with the bundled jdk was broken by native access refactoring. This commit fixes the linking issue, as well as adds a packaging test to ensure memory locking is invoked on all supported platforms.

closes #111847

Memory locking on Windows with the bundled jdk was broken by native
access refactoring. This commit fixes the linking issue, as well as adds
a packaging test to ensure memory locking is invoked on all supported
platforms.
@rjernst rjernst added >bug :Core/Infra/Core Core issues without another label labels Aug 14, 2024
@rjernst rjernst requested a review from a team as a code owner August 14, 2024 00:20
@elasticsearchmachine elasticsearchmachine added v8.16.0 Team:Core/Infra Meta label for core/infra team labels Aug 14, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine
Copy link
Collaborator

Hi @rjernst, I've created a changelog YAML for you.

Copy link
Contributor

@ldematte ldematte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left one suggestion on how to test

"false",
"discovery.type",
"single-node"));
// TODO: very locking worked. logs? check memory of process? at least we know the process started successfully
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the best (but complicated) way of doing this it to check the memory of the process, by calling VirtualQueryEx (and/or the equivalent function under linux/macos) from the test.
It does work cross process, so it should be possible to do that even in a test that spawns an external cluster. No idea how to do that with a docker test though...
Another idea: expose the information we need via an _nodes/stats (under os.mem maybe?). Could be useful regardless (e.g. for diagnostics)

@elasticsearchmachine
Copy link
Collaborator

Hi @rjernst, I've updated the changelog YAML for you.

@rjernst rjernst merged commit 0cf9c54 into elastic:main Aug 15, 2024
15 checks passed
@rjernst rjernst deleted the native/windows_memory_locking branch August 15, 2024 19:00
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.15

rjernst added a commit to rjernst/elasticsearch that referenced this pull request Aug 15, 2024
Memory locking on Windows with the bundled jdk was broken by native
access refactoring. This commit fixes the linking issue, as well as adds
a packaging test to ensure memory locking is invoked on all supported
platforms.
elasticsearchmachine pushed a commit that referenced this pull request Aug 15, 2024
Memory locking on Windows with the bundled jdk was broken by native
access refactoring. This commit fixes the linking issue, as well as adds
a packaging test to ensure memory locking is invoked on all supported
platforms.
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Aug 16, 2024
* upstream/main: (91 commits)
  Mute org.elasticsearch.xpack.test.rest.XPackRestIT org.elasticsearch.xpack.test.rest.XPackRestIT elastic#111944
  Add audit_unenrolled_* attributes to fleet-agents template (elastic#111909)
  Fix windows memory locking (elastic#111866)
  Update OAuth2 OIDC SDK (elastic#108799)
  Adds a warning about manually mounting snapshots managed by ILM (elastic#111883)
  Update geoip fixture files and utility methods (elastic#111913)
  Updated Function Score Query Test with Explain Fixes for 8.15.1 (elastic#111929)
  Mute org.elasticsearch.xpack.sql.qa.security.JdbcCsvSpecIT org.elasticsearch.xpack.sql.qa.security.JdbcCsvSpecIT elastic#111923
  [ESQL] date nanos binary comparisons (elastic#111908)
  [DOCS] Documents output_field behavior after multiple inference runs (elastic#111875)
  Add additional BlobCacheMetrics, expose BlobCacheMetrics via SharedBlobCacheService (elastic#111730)
  Mute org.elasticsearch.xpack.sql.qa.multi_cluster_with_security.JdbcCsvSpecIT org.elasticsearch.xpack.sql.qa.multi_cluster_with_security.JdbcCsvSpecIT elastic#111923
  Mute org.elasticsearch.xpack.sql.qa.multi_cluster_with_security.JdbcCsvSpecIT test {agg-ordering.testHistogramDateTimeWithCountAndOrder_2} elastic#111919
  Mute org.elasticsearch.xpack.sql.qa.multi_cluster_with_security.JdbcCsvSpecIT test {date.testDateParseHaving} elastic#111921
  Mute org.elasticsearch.xpack.sql.qa.multi_cluster_with_security.JdbcCsvSpecIT test {agg-ordering.testHistogramDateTimeWithCountAndOrder_1} elastic#111918
  Mute org.elasticsearch.xpack.sql.qa.multi_cluster_with_security.JdbcCsvSpecIT test {datetime.testDateTimeParseHaving} elastic#111922
  Mute org.elasticsearch.xpack.sql.qa.single_node.JdbcCsvSpecIT org.elasticsearch.xpack.sql.qa.single_node.JdbcCsvSpecIT elastic#111923
  Mute org.elasticsearch.xpack.sql.qa.single_node.JdbcCsvSpecIT test {agg-ordering.testHistogramDateTimeWithCountAndOrder_1} elastic#111918
  Mute org.elasticsearch.xpack.sql.qa.single_node.JdbcCsvSpecIT test {datetime.testDateTimeParseHaving} elastic#111922
  Mute org.elasticsearch.xpack.sql.qa.single_node.JdbcCsvSpecIT test {date.testDateParseHaving} elastic#111921
  ...

# Conflicts:
#	server/src/main/java/org/elasticsearch/TransportVersions.java
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Aug 18, 2024
The `known-issue-8.15.0` anchor appears twice which breaks the docs
build. Also the existing message suggests incorrectly that
`bootstrap.memory_lock: true` is recommended.
elasticsearchmachine pushed a commit that referenced this pull request Aug 19, 2024
The `known-issue-8.15.0` anchor appears twice which breaks the docs
build. Also the existing message suggests incorrectly that
`bootstrap.memory_lock: true` is recommended.
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Aug 19, 2024
* upstream/main:
  Fail `indexDocs()` on rejection (elastic#111962)
  Move repo analyzer to its own package (elastic#111963)
  Add generated evaluators for DateNanos conversion functions (elastic#111961)
  Clean the last traces from global retention in templates (elastic#111669)
  Fix known issue docs for elastic#111866 (elastic#111956)
  x-pack/plugin/otel: introduce x-pack-otel plugin (elastic#111091)
  Improve reaction to blob store corruptions (elastic#111954)
  Introduce `StreamingXContentResponse` (elastic#111933)
  Revert "Add 8.15.0 known issue for memory locking in Windows (elastic#111949)"
  Test get-snapshots API with missing details (elastic#111903)
  Add 8.15.0 known issue for memory locking in Windows (elastic#111949)

# Conflicts:
#	server/src/main/java/org/elasticsearch/TransportVersions.java
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Sep 4, 2024
Memory locking on Windows with the bundled jdk was broken by native
access refactoring. This commit fixes the linking issue, as well as adds
a packaging test to ensure memory locking is invoked on all supported
platforms.
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Sep 4, 2024
The `known-issue-8.15.0` anchor appears twice which breaks the docs
build. Also the existing message suggests incorrectly that
`bootstrap.memory_lock: true` is recommended.
davidkyle pushed a commit to davidkyle/elasticsearch that referenced this pull request Sep 5, 2024
Memory locking on Windows with the bundled jdk was broken by native
access refactoring. This commit fixes the linking issue, as well as adds
a packaging test to ensure memory locking is invoked on all supported
platforms.
davidkyle pushed a commit to davidkyle/elasticsearch that referenced this pull request Sep 5, 2024
The `known-issue-8.15.0` anchor appears twice which breaks the docs
build. Also the existing message suggests incorrectly that
`bootstrap.memory_lock: true` is recommended.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team v8.15.1 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elasticsearch 8.15 fails to start on Windows with bootstrap.memory_lock
3 participants