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

Simplify pivot aggregation search in events #17604

Merged
merged 20 commits into from Feb 14, 2024

Conversation

todvora
Copy link
Contributor

@todvora todvora commented Dec 6, 2023

/nocl

Description

This tiny change simplifies significantly the request-response structure of the aggregation. This then avoids many possible parsing errors of the aggregations structure.

Motivation and Context

Fixes #17314

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@todvora todvora changed the title Simplify pivot aggregation search Simplify pivot aggregation search in events Dec 7, 2023
@patrickmann
Copy link
Contributor

patrickmann commented Dec 11, 2023

Fixes most of the exceptions with missing fields.
But if only non-existent fields are specified as group-by, we still see exceptions in EventProcessorExecutionJob. No events are generated.
A corner case, but replay search shows correct event counts, even for this case.

image

2023-12-11 15:53:31,810 ERROR: org.graylog.events.processor.EventProcessorExecutionJob - Event processor <aggregation-v1/653b7e8743697269725dd634> failed to execute: Couldn't create events for: test (possibly due to non-existing grouping fields) (retry in 5000 ms)
org.graylog.events.processor.EventProcessorException: Couldn't create events for: test (possibly due to non-existing grouping fields)
at org.graylog.events.processor.aggregation.AggregationEventProcessor.eventsFromAggregationResult(AggregationEventProcessor.java:362) ~[classes/:?]
...
Caused by: java.lang.IndexOutOfBoundsException: index (1) must be less than size (1)
... at org.graylog.events.processor.aggregation.AggregationEventProcessor.eventsFromAggregationResult(AggregationEventProcessor.java:358) ~[classes/:?]

Copy link
Contributor

@patrickmann patrickmann left a comment

Choose a reason for hiding this comment

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

Can't handle only missing group-by fields

@todvora
Copy link
Contributor Author

todvora commented Dec 12, 2023

Thanks @patrickmann for the review, I'll look at this specific case as well. Adding full integration tests now, so it will be easier to verify such behavior.

@todvora
Copy link
Contributor Author

todvora commented Dec 13, 2023

I can reproduce the problem with all-unknown fields error in an integration test now, continue on a fix.

@todvora todvora marked this pull request as draft December 22, 2023 08:41
@dennisoelkers dennisoelkers force-pushed the fix/simplify-pivot-aggregation-search branch from dd34592 to 89ad0d2 Compare February 13, 2024 07:58
@todvora todvora marked this pull request as ready for review February 13, 2024 13:26
@todvora todvora merged commit 4866d70 into master Feb 14, 2024
9 checks passed
@todvora todvora deleted the fix/simplify-pivot-aggregation-search branch February 14, 2024 07:15
todvora added a commit that referenced this pull request Feb 14, 2024
todvora added a commit that referenced this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Event Aggregation fails when aggregating on missing fields
3 participants