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

refactor search source warnings to return a single warning for 'is_partial' results #165512

Merged
merged 49 commits into from Sep 14, 2023

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Sep 1, 2023

Closes #164905

This PR replaces individual shard failure and timeout warnings with a single "incomplete data" warning. This work is required for #163381

Screen Shot 2023-09-06 at 9 35 52 AM Screen Shot 2023-09-06 at 9 36 00 AM Screen Shot 2023-09-06 at 9 36 07 AM

Test instructions

  • Install flights and web logs sample data
  • Create data view kibana_sample_data*. Set time field to timestamp
  • open discover and select kibana_sample_data* data view
  • Add filter with custom DSL
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs",
            "shard_ids": [
              0
            ]
          }
        ]
      }
    }
    

@nreese
Copy link
Contributor Author

nreese commented Sep 5, 2023

@elasticmachine merge upstream

@nreese nreese requested a review from jughosta September 7, 2023 17:45
@nreese
Copy link
Contributor Author

nreese commented Sep 11, 2023

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented Sep 12, 2023

@elasticmachine merge upstream

return Object.values(state.layers).flatMap((layer) =>
if (warning.type === 'incomplete') {
return hasUnsupportedDownsampledAggregationFailure(warning)
? Object.values(state.layers).flatMap((layer) =>
Copy link
Contributor

@stratoula stratoula Sep 13, 2023

Choose a reason for hiding this comment

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

@dej611 can you do a sanity check on the TSDB behavior?

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a specific FTR test for this case. I see it passing, so all good by me 👍

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

This looks good to me, I tested all editors and everything seems as expected. I just want a sanity check from Marco for downsampling warnings. He knows this area better than me

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Thanks!

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

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

Thanks, @nreese. This looks good to me. I left a few small comments below, but nothing worth holding you up over. Assuming you're able to review those comments, approving now so we don't hold you up further.

  • I noticed that the warning callout's dismiss button is using a primary (blue) colored icon. Would it be more fitting to use a warning (yellow) colored icon instead?

    CleanShot 2023-09-13 at 13 21 36

  • Is it necessary to show the same warning(s) both in a callout above the table and using the warning count and popover on the visualization embed? Would it make sense to suppress the warning count and popover from the visualization embed to avoid the warning redundancy (and simply rely on the warning callout above the table)? I believe the visualization embeds were developed with the ability to suppress warnings/errors.

    CleanShot 2023-09-13 at 13 23 10

Comment on lines 17 to 21
.shardFailureModal__desc {
// set for IE11, since without it depending on the content the width of the list
// could be much higher than the available screenspace
max-width: 686px;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still support IE11? If not, is this style necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is IE11 still supported? This css is just moving an existing css file so this is not being added, just changing locations.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like IE11 is unsupported as of 7.9+ (leaving aside that this isn't new code): https://www.elastic.co/support/matrix.

>
<FormattedMessage
id="data.search.searchSource.fetch.shardsFailedModal.showDetails"
id="data.search.searchSource.fetch.incompleteResultsModal.showDetails"
defaultMessage="Show details"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to change the Show details text to View details to match the verbiage we'll be using in the upcoming CCS updates?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're changing it to View details here, we should also update the error callout used in Discover too for consistency:

const showErrorMessage = i18n.translate('discover.errorCalloutShowErrorMessage', {
defaultMessage: 'Show details',
});

defaultMessage: 'Data might be incomplete because your request timed out',
type: 'incomplete',
message: i18n.translate('data.search.searchSource.fetch.incompleteResultsMessage', {
defaultMessage: 'The data might be incomplete or wrong.',
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand we're trying to make the messaging more general-purpose to account for multiple issues. But would it make sense to reference shards and partial data within the warning somehow? Perhaps something like: Index shards returned partial data. Information displayed here may be incomplete or incorrect.?

Copy link
Contributor Author

@nreese nreese Sep 13, 2023

Choose a reason for hiding this comment

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

At this level, the messaging should be high level. It would not be practical to explain why there is incomplete data in this message since there are some many different reasons for incomplete data and such a small space. More knowledgable users (or curious users) can explore the "detailed why" by clicking "view details". In the future, this will open #166021. This is give the user all of the context of why data is incomplete with screen real estate to clearly explain what is missing.

@nreese
Copy link
Contributor Author

nreese commented Sep 13, 2023

I noticed that the warning callout's dismiss button is using a primary (blue) colored icon. Would it be more fitting to use a warning (yellow) colored icon instead?

Resolved with 8f4f8cf

Is it necessary to show the same warning(s) both in a callout above the table and using the warning count and popover on the visualization embed? Would it make sense to suppress the warning count and popover from the visualization embed to avoid the warning redundancy (and simply rely on the warning callout above the table)? I believe the visualization embeds were developed with the ability to suppress warnings/errors.

This is existing behavior and is not impacted by this PR. I will leave it up to the @elastic/kibana-data-discovery team to make this change in the future.

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

No code review, just responding to some feedback.

Is it necessary to show the same warning(s) both in a callout above the table and using the warning count and popover on the visualization embed? Would it make sense to suppress the warning count and popover from the visualization embed to avoid the warning redundancy (and simply rely on the warning callout above the table)? I believe the visualization embeds were developed with the ability to suppress warnings/errors.

This is existing behavior and is not impacted by this PR. I will leave it up to the @elastic/kibana-data-discovery team to make this change in the future.

These warnings are for different requests, since the vis request is separate from the data grid request. In some cases one may return a warning while the other succeeds, and you would only see one warning in the UI in these cases.

It may make sense from a UX perspective to capture the vis warnings and somehow merge them with the data grid warnings, but currently the warnings are shown where they occurred and I would consider any attempt at merging them as a separate effort from this work.

Comment on lines 17 to 21
.shardFailureModal__desc {
// set for IE11, since without it depending on the content the width of the list
// could be much higher than the available screenspace
max-width: 686px;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like IE11 is unsupported as of 7.9+ (leaving aside that this isn't new code): https://www.elastic.co/support/matrix.

>
<FormattedMessage
id="data.search.searchSource.fetch.shardsFailedModal.showDetails"
id="data.search.searchSource.fetch.incompleteResultsModal.showDetails"
defaultMessage="Show details"
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're changing it to View details here, we should also update the error callout used in Discover too for consistency:

const showErrorMessage = i18n.translate('discover.errorCalloutShowErrorMessage', {
defaultMessage: 'Show details',
});

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Visualizations team changes LGTM!

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #40 / Search examples handling warnings with search source fetch should show search warnings in results tab

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
discover 650 651 +1
lens 1157 1162 +5
visualizations 340 345 +5
total +11

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/es-types 12 19 +7
data 2584 2577 -7
total -0

Async chunks

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

id before after diff
data 54.1KB 54.3KB +243.0B
discover 556.2KB 555.5KB -726.0B
lens 1.4MB 1.4MB -249.0B
unifiedHistogram 48.6KB 48.6KB -6.0B
visualizations 265.2KB 265.5KB +328.0B
total -410.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
data 26 24 -2

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
data 408.4KB 407.5KB -835.0B
Unknown metric groups

API count

id before after diff
@kbn/es-types 12 19 +7
@kbn/search-response-warnings 16 15 -1
data 3311 3308 -3
total +3

History

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

@nreese nreese merged commit f3b280f into elastic:main Sep 14, 2023
21 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 14, 2023
nreese added a commit that referenced this pull request Oct 2, 2023
Found duplicated type ShardFailure in data plugin. Same type removed
from
`src/plugins/data/public/shard_failure_modal/shard_failure_types.ts` in
#165512.

This PR removes some unneeded types from
`src/plugins/data/common/search/search_source/types.ts`.

---------

Co-authored-by: kibanamachine <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
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor search source warnings to return a single warning for 'is_partial' results