-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Dispatch large bulk requests to write thread #76736
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
Dispatch large bulk requests to write thread #76736
Conversation
Currently all of the coordinating action for a bulk request is performed on the transport thread. With Elasticsearch increasing its usage of compression, it is now possible that large bulk requests will be compressed at the coordinating stage when routing to other nodes. This commit moves the coordination of large bulk requsets to the write thread to avoid blocking the transport threads on costly CPU operations.
|
Pinging @elastic/es-distributed (Team:Distributed) |
henningandersen
left a comment
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.
| public class TransportBulkAction extends HandledTransportAction<BulkRequest, BulkResponse> { | ||
|
|
||
| private static final Logger logger = LogManager.getLogger(TransportBulkAction.class); | ||
| private static final long ONE_MEGABYTE = ByteSizeValue.ofMb(1).getBytes(); |
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.
nit: I prefer ByteSizeUnit.MB.toBytes(1), seems more direct. But it is mostly a preference so optional.
server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java
Outdated
Show resolved
Hide resolved
* master: (21 commits) [Test] More robust assertions for sorting and pagination (elastic#76654) [Test] Fix filename check on Windows (elastic#76807) Upgrade build scan plugin to 3.6.4 (elastic#76784) Remove keystore initial_md5sum (elastic#76835) Don't export docker images on assemble (elastic#76817) Fix testMasterStatsOnSuccessfulUpdate (elastic#76844) AwaitsFix for elastic#76840 Make Releasing Aggregation Buffers Safer (elastic#76741) Re-enable BWC tests after backport of elastic#76771 (elastic#76839) Dispatch large bulk requests to write thread (elastic#76736) Disable BWC tests for elastic#76771 Pull down beats artifacts when performing release tests Add timing stats to publication process (elastic#76771) Fix BanFailureLoggingTests some more (elastic#76668) Mention "warn threshold" in master service slowlog (elastic#76815) Fix DockerTests.test010Install Re-enable tests affected by elastic#75097 (elastic#76814) Fix testRecoveryIsCancelledAfterDeletingTheIndex (elastic#76644) Test fix -WildcardFieldMapperTests bad test data. (elastic#76819) Updating supported version after backporting the feature (elastic#76794) ... # Conflicts: # server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java
Currently all of the coordinating action for a bulk request is performed on the transport thread. With Elasticsearch increasing its usage of compression, it is now possible that large bulk requests will be compressed at the coordinating stage when routing to other nodes. This commit moves the coordination of large bulk requsets to the write thread to avoid blocking the transport threads on costly CPU operations.
Currently all of the coordinating action for a bulk request is performed
on the transport thread. With Elasticsearch increasing its usage of
compression, it is now possible that large bulk requests will be
compressed at the coordinating stage when routing to other nodes. This
commit moves the coordination of large bulk requsets to the write thread
to avoid blocking the transport threads on costly CPU operations.