-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add memory tracking to queued write operations #57573
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
Add memory tracking to queued write operations #57573
Conversation
ywelsch
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.
I've left two more minor asks, o.w. looking good.
| return validationException; | ||
| } | ||
|
|
||
| static long writeSizeInBytes(Stream<DocWriteRequest<?>> requestStream) { |
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.
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); |
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.
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
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.
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
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.
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.
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.
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.
Currently we do not track the memory consuming by in-process write operations. This commit adds a mechanism to track write operation memory usage.
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.
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.
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.
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.
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.
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.
Currently we do not track the memory consuming by in-process write
operations.
This commit adds a mechanism to track write operation memory usage.