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

Only log one types warning per bulk search request. #37446

Merged
merged 1 commit into from
Jan 15, 2019

Conversation

jtibshirani
Copy link
Contributor

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.

@jtibshirani jtibshirani added >non-issue :Search/Search Search-related issues that do not fall into other categories v7.0.0 labels Jan 15, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@jtibshirani jtibshirani changed the title Only emit one types warning per bulk search request. Only log one types warning per bulk search request. Jan 15, 2019
Copy link
Member

@cbuescher cbuescher left a 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;
}
}
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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;
}
}
Copy link
Member

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?

Copy link
Contributor Author

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.

@cbuescher cbuescher self-assigned this Jan 15, 2019
@markharwood
Copy link
Contributor

Looks good but I wonder if it's possible to make DeprecationLogger less expensive to call repeatedly?

@jtibshirani
Copy link
Contributor Author

@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?

Copy link
Member

@cbuescher cbuescher left a 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

@jtibshirani jtibshirani merged commit 0a3bff2 into elastic:master Jan 15, 2019
@jtibshirani jtibshirani deleted the types-warnings-in-msearch branch January 15, 2019 20:38
@markharwood
Copy link
Contributor

FYI - I opened #37530 for the DeprecationLogger performance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search/Search Search-related issues that do not fall into other categories v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants