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

Remove option to enable direct buffer pooling #47956

Merged
merged 16 commits into from
Oct 21, 2019

Conversation

Tim-Brooks
Copy link
Contributor

This commit removes the option to change the netty system properties to
reenable the direct buffer pooling. It also removes the need for us to
disable the buffer pooling in the system properties file. Instead, we
programmatically craete an allocator that is used by our networking
layer.

This commit does introduce an Elasticsearch property which allows the
user to fallback on the netty default allocator. If they choose this
option, they can configure the default allocator how they wish using the
standard netty properties.

This commit removes the option to change the netty system properties to
reenable the direct buffer pooling. It also removes the need for us to
disable the buffer pooling in the system properties file. Instead, we
programmatically craete an allocator that is used by our networking
layer.

This commit does introduce an Elasticsearch property which allows the
user to fallback on the netty default allocator. If they choose this
option, they can configure the default allocator how they wish using the
standard netty properties.
@Tim-Brooks Tim-Brooks added >non-issue :Distributed Coordination/Network Http and internode communication implementations v8.0.0 v7.5.0 labels Oct 11, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Network)

@Tim-Brooks
Copy link
Contributor Author

Tim-Brooks commented Oct 11, 2019

When we disabled direct buffer pooling in 7.4, we agreed that once it was determined to be stable we could remove the fallback mode. This commit moves to a world where we programmatically assign the buffer allocator and do not use the default netty one.

This commit does add a system property to allow expert users to fallback on the netty allocator (and therefore configure it how they like).

We still need to discuss this. The name of the system property is tentative. And this has some friction with the "unpooled" system property which we currently apply. We should perhaps move to a world where JvmErgonomics just tells us if we should use the unpooled allocator (based on heap size). However, then this has some tension with testing (we could add an Elasticsearch system property for the unpooled allocator that the tests apply es.allocator.unpooled or something).

@original-brownbear
Copy link
Member

allows the user to fallback on the netty default allocator.

I wonder if we should even allow this? I'm having a hard time seeing any situation where this would be helpful. On the other hand, if we keep this option around we have to continue to support/test it.
I think I'd rather just stick with CopyBytesSocketChannel since that seems to work in a safe and stable way now and keep it simple unless there's a good example for a situation where manually overriding the details of the allocator would be helpful?

@Tim-Brooks Tim-Brooks requested a review from ywelsch October 14, 2019 23:28
Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

I've left some minor comments, o.w. looking good

@Tim-Brooks Tim-Brooks requested a review from ywelsch October 18, 2019 18:10
Copy link
Member

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

Just one comment on the test http client change, otherwise looks good :)


@Override
public ByteBuf directBuffer(int initialCapacity, int maxCapacity) {
// TODO: Currently the Netty SslHandler requests direct ByteBufs even when interacting with the
Copy link
Member

Choose a reason for hiding this comment

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

NIT: Maybe link the relevant Netty issue in the TODO?

@Tim-Brooks Tim-Brooks requested a review from ywelsch October 21, 2019 15:26
Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -202,7 +202,7 @@ public CompositeByteBuf compositeDirectBuffer(int maxNumComponents) {

@Override
public boolean isDirectBufferPooled() {
return delegate.isDirectBufferPooled();
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps assert delegate.isDirectBufferPooled() == false?

@Tim-Brooks Tim-Brooks merged commit fc30e05 into elastic:master Oct 21, 2019
Tim-Brooks added a commit to Tim-Brooks/elasticsearch that referenced this pull request Oct 21, 2019
This commit removes the option to change the netty system properties to
reenable the direct buffer pooling. It also removes the need for us to
disable the buffer pooling in the system properties file. Instead, we
programmatically craete an allocator that is used by our networking
layer.

This commit does introduce an Elasticsearch property which allows the
user to fallback on the netty default allocator. If they choose this
option, they can configure the default allocator how they wish using the
standard netty properties.
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Oct 22, 2019
* elastic/master:
  [Docs] Fix opType options in IndexRequest API example. (elastic#48290)
  Simplify Shard Snapshot Upload Code (elastic#48155)
  Mute ClassificationIT tests (elastic#48338)
  Reenable azure repository tests and remove some randomization in http servers  (elastic#48283)
  Use an env var for the classpath of jar hell task (elastic#48240)
  Refactor FIPS BootstrapChecks to simple checks (elastic#47499)
  Add "format" to "range" queries resulted from optimizing a logical AND (elastic#48073)
  [DOCS][Transform] document limitation regarding rolling upgrade with 7.2, 7.3 (elastic#48118)
  Fail with a better error when if there are no ingest nodes (elastic#48272)
  Fix executing enrich policies stats (elastic#48132)
  Use MultiFileTransfer in CCR remote recovery (elastic#44514)
  Make BytesReference an interface (elastic#48171)
  Also validate source index at put enrich policy time. (elastic#48254)
  Add 'javadoc' task to lifecycle check tasks (elastic#48214)
  Remove option to enable direct buffer pooling (elastic#47956)
  [DOCS] Add 'Selecting gateway and seed nodes' section to CCS docs (elastic#48297)
  Add Enrich Origin (elastic#48098)
  fix incorrect comparison (elastic#48208)
danielmitterdorfer added a commit to danielmitterdorfer/rally-teams that referenced this pull request Oct 25, 2019
With this commit we align Rally with Elasticsearch's defaults as
implemented in elastic/elasticsearch#47956.

Relates elastic/elasticsearch#47956
danielmitterdorfer added a commit to elastic/rally-teams that referenced this pull request Oct 28, 2019
With this commit we align Rally with Elasticsearch's defaults as
implemented in elastic/elasticsearch#47956.

Relates elastic/elasticsearch#47956
Relates #33
danielmitterdorfer added a commit to elastic/rally-teams that referenced this pull request Oct 28, 2019
With this commit we align Rally with Elasticsearch's defaults as
implemented in elastic/elasticsearch#47956.

Relates elastic/elasticsearch#47956
Relates #33
@Tim-Brooks Tim-Brooks deleted the remove_fallback_allocator branch April 30, 2020 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants