Skip to content

Metrics for incremental bulk splits #116765

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

Merged
merged 21 commits into from
Nov 20, 2024
Merged

Conversation

ankikuma
Copy link
Contributor

Adding metrics to track incremental bulk request splits due to indexing pressure. Also added tests to test the metrics.

While writing tests I found that the low and high watermark thresholds in IncrementalBulkIT.java need a small tweak (without this tweak all splits are caused by high watermark thresholds and the low watermark thresholds don't kick in).

Resolves ES-9612

@ankikuma ankikuma added the :Distributed Indexing/Distributed A catch all label for anything in the Distributed Indexing Area. Please avoid if you can. label Nov 13, 2024
@ankikuma ankikuma marked this pull request as ready for review November 13, 2024 18:56
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Indexing Meta label for Distributed Indexing team label Nov 13, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

@elasticsearchmachine
Copy link
Collaborator

Hi @ankikuma, I've created a changelog YAML for you.

@ankikuma ankikuma requested a review from Tim-Brooks November 14, 2024 04:57

metrics.add(
registry.registerLongAsyncCounter(
"es.indexing.high_watermark_splits.total",
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 include coordinating in this name since it is at the coordinating level currently.

es.indexing.coordinating.low_watermark_splits.total
es.indexing.coordinating.high_watermark_splits.total

Copy link
Contributor

@Tim-Brooks Tim-Brooks left a comment

Choose a reason for hiding this comment

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

A couple of smaller comments.

@@ -160,6 +183,14 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
out.writeVLong(totalCoordinatingRequests);
}

if (out.getTransportVersion().onOrAfter(TransportVersions.INDEXING_PRESSURE_THROTTLING_STATS)) {
out.writeVLong(lowWaterMarkSplits);
Copy link
Contributor

Choose a reason for hiding this comment

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

These two branches can be joined.

@@ -85,6 +91,18 @@ public IndexingPressureStats(StreamInput in) throws IOException {
} else {
totalCoordinatingRequests = -1L;
}

if (in.getTransportVersion().onOrAfter(TransportVersions.INDEXING_PRESSURE_THROTTLING_STATS)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These two branches can be joined.

return (currentUsage >= lowWatermark && size >= lowWatermarkSize) || (currentUsage >= highWatermark && size >= highWatermarkSize);
if (currentUsage >= highWatermark && size >= highWatermarkSize) {
highWaterMarkSplits.getAndIncrement();
logger.trace(() -> Strings.format("Split bulk due to high watermark: currentUsage [%d] and size [%d]", currentUsage, size));
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps this should either be labelled "current bytes". Or the currentUsage variable should be printed in a bytes representation.

@@ -65,7 +65,7 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(IndexingPressure.SPLIT_BULK_LOW_WATERMARK.getKey(), "512B")
.put(IndexingPressure.SPLIT_BULK_LOW_WATERMARK_SIZE.getKey(), "2048B")
.put(IndexingPressure.SPLIT_BULK_HIGH_WATERMARK.getKey(), "2KB")
.put(IndexingPressure.SPLIT_BULK_HIGH_WATERMARK.getKey(), "4KB")
.put(IndexingPressure.SPLIT_BULK_HIGH_WATERMARK_SIZE.getKey(), "1024B")
.build();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There are tests in this class testIncrementalBulkLowWatermarkBackOff and testIncrementalBulkHighWatermarkBackOff. Can we modify them to ensure that IndexingPressure indexingPressure properly accounts for the splits? We check indexing pressure stats for other things in this IT so it should be a small addition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Done.

@Tim-Brooks Tim-Brooks self-requested a review November 19, 2024 20:10
Copy link
Contributor

@Tim-Brooks Tim-Brooks left a comment

Choose a reason for hiding this comment

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

LGTM

@ankikuma ankikuma merged commit abcdbf2 into elastic:main Nov 20, 2024
16 checks passed
rjernst pushed a commit to rjernst/elasticsearch that referenced this pull request Nov 20, 2024
Add metrics to track incremental bulk request splits due to indexing pressure. Resolves ES-9612
@Tim-Brooks Tim-Brooks added auto-backport Automatically create backport pull requests when merged backport pending v8.18.0 and removed backport pending labels Nov 21, 2024
ankikuma added a commit to ankikuma/elasticsearch that referenced this pull request Nov 21, 2024
Add metrics to track incremental bulk request splits due to indexing pressure. Resolves ES-9612
ankikuma added a commit that referenced this pull request Nov 21, 2024
Backport of PR #116765. Add metrics to track incremental bulk request splits due to indexing pressure. Resolves ES-9612
alexey-ivanov-es pushed a commit to alexey-ivanov-es/elasticsearch that referenced this pull request Nov 28, 2024
Add metrics to track incremental bulk request splits due to indexing pressure. Resolves ES-9612
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :Distributed Indexing/Distributed A catch all label for anything in the Distributed Indexing Area. Please avoid if you can. >enhancement Team:Distributed Indexing Meta label for Distributed Indexing team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants