Add memory tracking to queued write operations#57573
Merged
Tim-Brooks merged 64 commits intoelastic:masterfrom Jun 25, 2020
Merged
Add memory tracking to queued write operations#57573Tim-Brooks merged 64 commits intoelastic:masterfrom
Tim-Brooks merged 64 commits intoelastic:masterfrom
Conversation
ywelsch
approved these changes
Jun 24, 2020
Contributor
ywelsch
left a comment
There was a problem hiding this comment.
I've left two more minor asks, o.w. looking good.
| return validationException; | ||
| } | ||
|
|
||
| static long writeSizeInBytes(Stream<DocWriteRequest<?>> requestStream) { |
Contributor
There was a problem hiding this comment.
Is this method still useful now that we use the accountable interface? Let's have BulkShardRequest implement Accountable as well, and then use that directly instead of this method
|
|
||
| private final AtomicLong coordinatingBytes = new AtomicLong(0); | ||
| private final AtomicLong primaryBytes = new AtomicLong(0); | ||
| private final AtomicLong replicaBytes = new AtomicLong(0); |
Contributor
There was a problem hiding this comment.
Let's add some assertions to our test infra (InternalTestCluster) that the bytes here at the end of the test are always 0, similar to assertNoPendingIndexOperations.
henningandersen
approved these changes
Jun 24, 2020
server/src/main/java/org/elasticsearch/action/bulk/WriteMemoryLimits.java
Outdated
Show resolved
Hide resolved
...r/src/main/java/org/elasticsearch/action/support/replication/TransportReplicationAction.java
Outdated
Show resolved
Hide resolved
...r/src/main/java/org/elasticsearch/action/support/replication/TransportReplicationAction.java
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/elasticsearch/action/bulk/WriteMemoryLimitsIT.java
Show resolved
Hide resolved
Tim-Brooks
added a commit
to Tim-Brooks/elasticsearch
that referenced
this pull request
Jun 25, 2020
This is a follow-up to elastic#57573. This commit ensures that the bytes marked in `WriteMemoryLimits` are released by any test using an internal test cluster.
Tim-Brooks
added a commit
to Tim-Brooks/elasticsearch
that referenced
this pull request
Jun 25, 2020
This is a follow-up to elastic#57573. This commit combines coordinating and primary bytes under the same "write" bucket. Double accounting is prevented by only accounting the bytes at either the reroute phase or the primary phase. TransportBulkAction calls execute directly, so the operations handler is skipped and the bytes are not double accounted.
Tim-Brooks
added a commit
that referenced
this pull request
Jun 26, 2020
This is a follow-up to #57573. This commit ensures that the bytes marked in `WriteMemoryLimits` are released by any test using an internal test cluster.
Tim-Brooks
added a commit
that referenced
this pull request
Jul 1, 2020
This is a follow-up to #57573. This commit combines coordinating and primary bytes under the same "write" bucket. Double accounting is prevented by only accounting the bytes at either the reroute phase or the primary phase. TransportBulkAction calls execute directly, so the operations handler is skipped and the bytes are not double accounted.
Tim-Brooks
added a commit
to Tim-Brooks/elasticsearch
that referenced
this pull request
Jul 2, 2020
Currently we do not track the memory consuming by in-process write operations. This commit adds a mechanism to track write operation memory usage.
Tim-Brooks
added a commit
to Tim-Brooks/elasticsearch
that referenced
this pull request
Jul 2, 2020
This is a follow-up to elastic#57573. This commit ensures that the bytes marked in `WriteMemoryLimits` are released by any test using an internal test cluster.
Tim-Brooks
added a commit
that referenced
this pull request
Jul 2, 2020
This is a follow-up to #57573. This commit ensures that the bytes marked in WriteMemoryLimits are released by any test using an internal test cluster.
Tim-Brooks
added a commit
to Tim-Brooks/elasticsearch
that referenced
this pull request
Jul 2, 2020
This is a follow-up to elastic#57573. This commit combines coordinating and primary bytes under the same "write" bucket. Double accounting is prevented by only accounting the bytes at either the reroute phase or the primary phase. TransportBulkAction calls execute directly, so the operations handler is skipped and the bytes are not double accounted.
Tim-Brooks
added a commit
that referenced
this pull request
Jul 3, 2020
This is a follow-up to #57573. This commit combines coordinating and primary bytes under the same "write" bucket. Double accounting is prevented by only accounting the bytes at either the reroute phase or the primary phase. TransportBulkAction calls execute directly, so the operations handler is skipped and the bytes are not double accounted.
13 tasks
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
Nov 19, 2021
In elastic#57573 we introduced a `public static Logger logger` field in `TransportChannel` which some IDEs tend to automatically import if you mention an as-yet-undeclared `logger` field. This commit reverts that small part of elastic#57573 so that we go back to using a private logger belonging to `ChannelActionListener` instead.
DaveCTurner
added a commit
that referenced
this pull request
Nov 22, 2021
In #57573 we introduced a `public static Logger logger` field in `TransportChannel` which some IDEs tend to automatically import if you mention an as-yet-undeclared `logger` field. This commit reverts that small part of #57573 so that we go back to using a private logger belonging to `ChannelActionListener` instead.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently we do not track the memory consuming by in-process write
operations.
This commit adds a mechanism to track write operation memory usage.