Skip to content

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Sep 14, 2025

This change reworks the computation of resets to remove the need for using delta.

@dnhatn dnhatn force-pushed the fix-rate-intermediate-states branch from 2c8a127 to ce36555 Compare September 14, 2025 17:57
@dnhatn dnhatn added >non-issue :StorageEngine/TSDB You know, for Metrics labels Sep 15, 2025
@dnhatn dnhatn marked this pull request as ready for review September 15, 2025 05:39
@dnhatn dnhatn requested a review from kkrik-es September 15, 2025 05:39
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

while (j < count) {
mergedTimestamps[k] = ts.getLong(tsFirst + j);
mergedValues[k++] = vs.getLong(vsFirst + j++);
assert count % 2 == 0 : "expected even number of values for intervals, got " + count + " in " + ts;
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I missed this, why is this the case?

Copy link
Member Author

Choose a reason for hiding this comment

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

We serialize two values for each interval and here assert that the intervals have been serialized correctly.

} else {
timestamps.appendLong(state.timestamps[0]);
values.appendLong(state.values[0]);
// don't combine intervals until final as we might have overlapping intervals from other indices
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering, does this mean that we need to send all the data to the coordinating node? Or, we still reduce in the data nodes, before collecting the per-shard data in the coordinating node?

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated the comments. We still reduce data points in each shard to a single interval (t1, v1, t2, v2), but we no longer combine intervals across shards until the final phase

Copy link
Contributor

@kkrik-es kkrik-es left a comment

Choose a reason for hiding this comment

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

Make sure you run the randomized test a few times :)

LG, thanks Nhat. Just a few minor questions, mostly orthogonal.

@dnhatn
Copy link
Member Author

dnhatn commented Sep 15, 2025

Thanks Kostas!

@dnhatn dnhatn merged commit 8cb29e0 into elastic:main Sep 15, 2025
36 checks passed
@dnhatn dnhatn deleted the fix-rate-intermediate-states branch September 15, 2025 17:01
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Sep 17, 2025
This change reworks the computation of resets to remove the need 
for using delta.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants