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

[ML] Data Frame Analytics: Fix race condition and support for feature influence legacy format. #81123

Merged
merged 7 commits into from
Oct 21, 2020

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Oct 20, 2020

Summary

Fixes #81150
Part of #77046

  • Fixes a race condition where searches for data grid results with different parameters would return in different order with the wrong results on display. Fix uses a pattern to cancel useEffect callback for getIndexData().
  • Fixes identifying pre 7.10 feature influence format for outlier detection and will display a callout on the results page with information for a workaround.
  • To fix identifying the legacy format, some cleanup of other code relating to the old format had to be done. The ml results object field is no longer treated as a "special" field for outlier detection and is treated and retrieved in the same way as other fields.
  • Adds an error callout if no Kibana index pattern is available for source/dest index.

Checklist

@walterra walterra added bug Fixes for quality problems that affect the customer experience regression :ml v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Data Frame Analytics ML data frame analytics features v7.10.0 v7.11.0 labels Oct 20, 2020
@walterra walterra requested a review from a team as a code owner October 20, 2020 10:13
@walterra walterra self-assigned this Oct 20, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)


setTableItems(docs);
setStatus(INDEX_STATUS.LOADED);
if (!options.didCancel) {
Copy link
Contributor

Choose a reason for hiding this comment

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

For regression and classification jobs, the results grid is failing to display for me:

image

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested latest edits and LGTM

@peteharverson
Copy link
Contributor

If the index pattern does not exist for the results index, the callout appears even if the feature influence is in the correct format:

image

@peteharverson peteharverson self-requested a review October 20, 2020 13:16
const options = { didCancel: false };
getIndexData(jobConfig, dataGrid, searchQuery, options);
return () => {
options.didCancel = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we create a custom hook, let's call it useSafeEffect for instance, that wraps the callback with didCancel check under the hood?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep that's something we could do in a follow up for 7.11 - for this 7.10 fix I wanted to touch as little code as possible that's why I went for duplicate code and no new utils. i'd also like to refactor getIndexData a bit so we don't have to use the mutable object but just a plain variable.

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested latest commit and LGTM

@walterra
Copy link
Contributor Author

@alvarezmelissa87 Added an error callout when both index patterns for source/dest index are missing, ready for review :)

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

Left a comment regarding classification/regression results page when there is no source/destination index pattern.

@alvarezmelissa87
Copy link
Contributor

When I navigate to results view for Regression or Classification jobs that don't have a source and destination index I now get a blank page instead of an error callout with a useful message.

image

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

Tested latest edits and LGTM ⚡

@walterra walterra merged commit 4ba2fdb into elastic:master Oct 21, 2020
@walterra walterra deleted the ml-analytics-outlier-legacy-format branch October 21, 2020 05:57
walterra added a commit to walterra/kibana that referenced this pull request Oct 21, 2020
… influence legacy format. (elastic#81123)

- Fixes a race condition where searches for data grid results with different parameters would return in different order with the wrong results on display. Fix uses a pattern to cancel useEffect callback for getIndexData().
- Fixes identifying pre 7.10 feature influence format for outlier detection and will display a callout on the results page with information for a workaround.
- To fix identifying the legacy format, some cleanup of other code relating to the old format had to be done. The ml results object field is no longer treated as a "special" field for outlier detection and is treated and retrieved in the same way as other fields.
- Adds an error callout if no Kibana index pattern is available for source/dest index.
walterra added a commit to walterra/kibana that referenced this pull request Oct 21, 2020
… influence legacy format. (elastic#81123)

- Fixes a race condition where searches for data grid results with different parameters would return in different order with the wrong results on display. Fix uses a pattern to cancel useEffect callback for getIndexData().
- Fixes identifying pre 7.10 feature influence format for outlier detection and will display a callout on the results page with information for a workaround.
- To fix identifying the legacy format, some cleanup of other code relating to the old format had to be done. The ml results object field is no longer treated as a "special" field for outlier detection and is treated and retrieved in the same way as other fields.
- Adds an error callout if no Kibana index pattern is available for source/dest index.
peteharverson pushed a commit that referenced this pull request Oct 21, 2020
… influence legacy format. (#81123) (#81275)

- Fixes a race condition where searches for data grid results with different parameters would return in different order with the wrong results on display. Fix uses a pattern to cancel useEffect callback for getIndexData().
- Fixes identifying pre 7.10 feature influence format for outlier detection and will display a callout on the results page with information for a workaround.
- To fix identifying the legacy format, some cleanup of other code relating to the old format had to be done. The ml results object field is no longer treated as a "special" field for outlier detection and is treated and retrieved in the same way as other fields.
- Adds an error callout if no Kibana index pattern is available for source/dest index.
peteharverson pushed a commit that referenced this pull request Oct 21, 2020
… influence legacy format. (#81123) (#81276)

- Fixes a race condition where searches for data grid results with different parameters would return in different order with the wrong results on display. Fix uses a pattern to cancel useEffect callback for getIndexData().
- Fixes identifying pre 7.10 feature influence format for outlier detection and will display a callout on the results page with information for a workaround.
- To fix identifying the legacy format, some cleanup of other code relating to the old format had to be done. The ml results object field is no longer treated as a "special" field for outlier detection and is treated and retrieved in the same way as other fields.
- Adds an error callout if no Kibana index pattern is available for source/dest index.
jloleysens added a commit to jloleysens/kibana that referenced this pull request Oct 21, 2020
…arm-phase-to-formlib

* 'master' of github.com:elastic/kibana: (55 commits)
  [UX] Fix map color variance and apply proper filter for extended stats (elastic#81106)
  [User Experience] Use EuiSelect for percentiles instead of SuperSelect (elastic#81082)
  [DOCS] Add link for monitoring ssl settings (elastic#81057)
  [test] Await loading indicator in monitoring test (elastic#81279)
  [ILM] Minor copy and link additions to cloud CTA for cold phase (elastic#80512)
  [Mappings editor] Add scaled_float and date_range comp integration tests (elastic#81287)
  [Discover] Deangularize context.app (elastic#80851)
  [O11y Overview] Add code to display/hide UX section when appropriate (elastic#80873)
  [Discover] Extend DiscoverNoResults component to show different message on error (elastic#79671)
  Fix tagcloud word overlapping (elastic#81161)
  [Security Solution] Fixes flaky test rules (elastic#81040)
  Changed the code to avoid tech debt with hacky solutions after receiving comments on EUI issue reported about this problem. (elastic#81183)
  [Security Solution][All] Replace old markdown renderer with the new one (elastic#80301)
  Add namespaced version of the API call (elastic#81278)
  [ML] Data Frame Analytics: Fix race condition and support for feature influence legacy format. (elastic#81123)
  [Fleet] Fix POLICY_CHANGE action creation for new policy (elastic#81236)
  [Security Solution][Endpoint][Admin] Malware user notification checkbox (elastic#78084)
  [SecuritySolution][Unit Tests] - fix flakey unit test (elastic#81239)
  skip flaky suite (elastic#81264)
  [Maps] fix top-level Map page is called 'Kibana' (elastic#81238)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared/forcemerge_field.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase.tsx
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id before after diff
ml 7.3MB 7.3MB +6.3KB

History

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Data Frame Analytics ML data frame analytics features :ml regression release_note:skip Skip the PR/issue when compiling release notes v7.10.0 v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Data Frame Analytics results UI - no warning if no index pattern exists
6 participants