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

[Lens] Faster field existence failures by adding timeouts #97188

Merged
merged 7 commits into from
Apr 19, 2021

Conversation

wylieconlon
Copy link
Contributor

@wylieconlon wylieconlon commented Apr 14, 2021

We've decided that if the field existence query takes too long, we want to fail and show all fields. I've been unable to find large improvements to the performance, but there are some small improvements to the failure case added here.

One case that is hard to work with is many shards: there is a per-shard timeout and a global timeout, so I've set the per-shard timeout very low and the per-shard timeout higher.

This adds a new timeout warning to the field list:

Screen Shot 2021-04-15 at 1 45 17 PM

Closes #92493

@wylieconlon wylieconlon added Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Lens v7.13.0 labels Apr 14, 2021
@wylieconlon wylieconlon requested a review from a team April 14, 2021 21:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested and still works fine, LGTM.

Two notes:

  • Should we extend the error message shown in the UI with the ES error message (or maybe hide it if it's because of a timeout)? Some users will always see this warning triangle because their cluster is slow. We did something similar for the input control vis and it caused quite some user confusion (Input controls: Improve behavior on terms list timeout #73253)
  • 500ms to 5s seems like a pretty big difference - could you explain how you arrived at these values? I'm no expert, but I would have expected the shard timeout to be much higher.

@wylieconlon
Copy link
Contributor Author

@flash1293 I will look at options to show a better explanation/icon for timeouts vs other types of failures. Maybe a clock icon instead of a warning triangle would be appropriate.

I can clarify this using a comment in the issue, but you're right that we could move the timeouts closer together, for example we could do 4s and 5s. One of the interesting things about a super-short timeout is that each shard will return partial results if it's found any in the time, which is kind of similar to the sampling ideas we've talked about. But if ES is bottlenecked for some reason it's probably best to have a slower timeout.

@wylieconlon
Copy link
Contributor Author

@flash1293 please take another look as I've hooked up a new key in the state. I tested locally by setting the timeout super low.

@mbondyra
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

I love this way of indicating timeouts - it's clear what's happening and users will know what to expect.

Just one thing I would like to change - as soon as you run into the timeout, field information popovers also won't be populated. This doesn't seem necessary, IMHO we should still try to run these requests even if the existence query timed out.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 943.8KB 944.8KB +1.0KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@wylieconlon wylieconlon added the auto-backport Deprecated - use backport:version if exact versions are needed label Apr 19, 2021
@wylieconlon wylieconlon merged commit 9bc66ed into elastic:master Apr 19, 2021
@wylieconlon wylieconlon deleted the lens/existence-performance branch April 19, 2021 22:18
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 19, 2021
)

* [Lens] Faster field existence failures by adding timeouts

* Increase shard timeout and add timeout-specific warning

* Fix types

* Fix import

* Hide field info when in error state, but not timeout

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Apr 20, 2021
…97551)

* [Lens] Faster field existence failures by adding timeouts

* Increase shard timeout and add timeout-specific warning

* Fix types

* Fix import

* Hide field info when in error state, but not timeout

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Wylie Conlon <william.conlon@elastic.co>
madirey pushed a commit to madirey/kibana that referenced this pull request May 11, 2021
)

* [Lens] Faster field existence failures by adding timeouts

* Increase shard timeout and add timeout-specific warning

* Fix types

* Fix import

* Hide field info when in error state, but not timeout

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Existence fetch can take a long time
5 participants