-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Only log one types warning per bulk search request. #37446
Only log one types warning per bulk search request. #37446
Conversation
Pinging @elastic/es-search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtibshirani left two short comments around testing, maybe those cases are already covered, otherwise adding them would be nice. Rest looks good to me.
deprecationLogger.deprecatedAndMaybeLog("msearch_with_types", TYPES_DEPRECATION_MESSAGE); | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be unit tested, since a similar looking test is removed from MultiSearchTemplateRequestTests? Maybe it already is tested elsewhere, but I don't see it in this PR so just asking to check to make sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this deprecation warning is tested in RestMultiSearchTemplateActionTests
. The assertWarnings
call in MultiSearchTemplateRequestTests
wasn't there to explicitly test the deprecation, but rather to make sure the test didn't fail on unexpected warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, and sorry for bothering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, I really appreciate your constant emphasis on tests!
deprecationLogger.deprecatedAndMaybeLog("msearch_with_types", TYPES_DEPRECATION_MESSAGE); | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, is there a unit test already? Otherwise is is possible to add one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise these deprecations are covered by RestMultiSearchActionTests
.
Looks good but I wonder if it's possible to make DeprecationLogger less expensive to call repeatedly? |
@markharwood I agree that ideally we'd fix the underlying issue with the slow deduplication of warning headers. Maybe we could file an issue (separate from this PR) with a description of the problem, so that the core-infra team could take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtibshirani thanks for the clarification on the tests, the rest LGTM
FYI - I opened #37530 for the DeprecationLogger performance |
In #37411, we found that issuing multiple types deprecation warnings in a
_bulk
indexing request led to a large performance regression in the nightly benchmarks. This is likely because warnings are deduplicated when added to the response header, which requires some string parsing.This PR applies the same fix to msearch and msearch template requests as we did for bulk requests, to prevent any possibility of slowdown there.