Skip to content
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

Fix count aggregation exemplar data #4341

Merged
merged 4 commits into from
Apr 1, 2024

Conversation

kkondaka
Copy link
Collaborator

Description

Count aggregation incorrectly maintains a global value for exemplars. Exemplars should be maintained per groupState.
This change fixes it and maintains a different exemplar for different aggregate groups.

Issues Resolved

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • [X ] New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • [X ] Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
chenqi0805
chenqi0805 previously approved these changes Mar 28, 2024
@@ -86,8 +87,7 @@ public AggregateActionResponse handleEvent(final Event event, final AggregateAct
groupState.put(startTimeKey, Instant.now());
groupState.putAll(aggregateActionInput.getIdentificationKeys());
groupState.put(countKey, 1);
exemplarList = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

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

We should remove this field and make it a local only.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, you can just remove the field. It should now be unused.

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
dlvenable
dlvenable previously approved these changes Mar 28, 2024
Copy link
Member

@dlvenable dlvenable left a comment

Choose a reason for hiding this comment

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

The changes look good. I noticed the Gradle builds were failing in the previous commit.

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-15df884d.us-west-2.amazon.com>
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-15df884d.us-west-2.amazon.com>
@kkondaka kkondaka merged commit f7191c9 into opensearch-project:main Apr 1, 2024
47 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 1, 2024
* Fix count aggregation exemplar data

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>

* Addressed comments

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>

* Fixed failing tests

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-15df884d.us-west-2.amazon.com>

* Fixed failing tests

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-15df884d.us-west-2.amazon.com>

---------

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-15df884d.us-west-2.amazon.com>
Co-authored-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
Co-authored-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-15df884d.us-west-2.amazon.com>
(cherry picked from commit f7191c9)
kkondaka added a commit that referenced this pull request Apr 1, 2024
* Fix count aggregation exemplar data

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>

* Addressed comments

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>

* Fixed failing tests

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-15df884d.us-west-2.amazon.com>

* Fixed failing tests

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-15df884d.us-west-2.amazon.com>

---------

Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-15df884d.us-west-2.amazon.com>
Co-authored-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
Co-authored-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-15df884d.us-west-2.amazon.com>
(cherry picked from commit f7191c9)

Co-authored-by: Krishna Kondaka <41027584+kkondaka@users.noreply.github.com>
@kkondaka kkondaka deleted the count-aggr-fix branch May 13, 2024 05:51
@kkondaka kkondaka added this to the v2.8 milestone May 14, 2024
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