Skip to content

Conversation

@Tim-Brooks
Copy link
Contributor

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 Tim-Brooks requested a review from ywelsch June 18, 2020 16:34
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 two more minor asks, o.w. looking good.

return validationException;
}

static long writeSizeInBytes(Stream<DocWriteRequest<?>> requestStream) {
Copy link
Contributor

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);
Copy link
Contributor

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.

Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

LGTM.

@Tim-Brooks Tim-Brooks merged commit c16a455 into elastic:master Jun 25, 2020
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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >non-issue Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.9.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants