-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fix csv generation when search:includeFrozen
is enabled
#152354
Conversation
@tsullivan, is this what you had in mind here? #151546 (comment) |
@@ -66,6 +66,8 @@ export class CsvGenerator { | |||
index: indexPatternTitle, | |||
keep_alive: duration, | |||
ignore_unavailable: true, | |||
// @ts-ignore | |||
ignore_throttled: settings.includeFrozen ? false : undefined, // "true" will cause deprecation warnings logged in ES |
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.
This is strange, but in my testing I found that this option doesn't seem to do anything when used with PIT. It seems like when PIT is used the search always includes frozen indices.
This leads to the situation that when include frozen is false (default), discover won't show them, but csv will
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.
Hm, is there not a way to ignore frozen indices when using PIT? I don't see that mentioned in the docs. Can we run this by the ES search team?
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.
I've reached out to the ES team, to get ideas why this happens.
Unfortunately, the change in the PR doesn't really seem to do anything, and has the side-effect of adding a ts-ignore
line, since ignore_throttled
isn't part of the OpenPointInTimeRequest
interface. I believe we can probably drop awareness of the includeFrozen
setting from this code, to resolve the bug and not add the ts-ignore
line.
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.
Let's keep this here, but link to elastic/elasticsearch#94377 after the ts-ignore
, so anyone reading the code can understand why it is ignored. When the ES issue is resolved, the functionality should just work as the user intends, and at that point we might be able to just remove the ts-ignore
as part of minor cleanup.
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.
I have merged elastic/elasticsearch#94377. I think you can remove this workaround.
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.
Opened to clean up: #153359
Pinging @elastic/appex-sharedux (Team:SharedUX) |
I think this is the right approach for the bug. Apologies that I wrote a different proposal earlier on - but I think these changes highlight that SearchSource is not putting the |
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.
Let's try to understand if always including frozen indices with PIT is intentional
@@ -66,6 +66,8 @@ export class CsvGenerator { | |||
index: indexPatternTitle, | |||
keep_alive: duration, | |||
ignore_unavailable: true, | |||
// @ts-ignore | |||
ignore_throttled: settings.includeFrozen ? false : undefined, // "true" will cause deprecation warnings logged in ES |
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.
Hm, is there not a way to ignore frozen indices when using PIT? I don't see that mentioned in the docs. Can we run this by the ES search team?
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.
The ignore_throttled
isn't part of the OpenPointInTimeRequest interface, which indicates we probably don't need to handle it at all. But let's wait to hear what the ES team has to say.
@@ -66,6 +66,8 @@ export class CsvGenerator { | |||
index: indexPatternTitle, | |||
keep_alive: duration, | |||
ignore_unavailable: true, | |||
// @ts-ignore | |||
ignore_throttled: settings.includeFrozen ? false : undefined, // "true" will cause deprecation warnings logged in ES |
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.
I've reached out to the ES team, to get ideas why this happens.
Unfortunately, the change in the PR doesn't really seem to do anything, and has the side-effect of adding a ts-ignore
line, since ignore_throttled
isn't part of the OpenPointInTimeRequest
interface. I believe we can probably drop awareness of the includeFrozen
setting from this code, to resolve the bug and not add the ts-ignore
line.
Yes, agree, this would be better if there is no intention to change the behavior on es side
it isn't part of the interface but es accepts as a valid option inside the request. So there is a validation level that allows the option, but the internal implementation doesn't seem to be using it. |
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.
LGTM, but first let's add a way to track the issue in ES by linking to elastic/elasticsearch#94377
@@ -66,6 +66,8 @@ export class CsvGenerator { | |||
index: indexPatternTitle, | |||
keep_alive: duration, | |||
ignore_unavailable: true, | |||
// @ts-ignore | |||
ignore_throttled: settings.includeFrozen ? false : undefined, // "true" will cause deprecation warnings logged in ES |
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.
Let's keep this here, but link to elastic/elasticsearch#94377 after the ts-ignore
, so anyone reading the code can understand why it is ignored. When the ES issue is resolved, the functionality should just work as the user intends, and at that point we might be able to just remove the ts-ignore
as part of minor cleanup.
Thanks @tsullivan, I added a comment and link to the issue: #152884 |
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
…2354) fix elastic#151546 see: elastic#151546 (comment) Since it isn't possible to freeze an index in 8.x to test you have to create an index and freeze it in 7.x and then upgrade to 8.x. (cherry picked from commit 00e0f5c)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
) (#152901) # Backport This will backport the following commits from `main` to `8.7`: - [Fix csv generation when `search:includeFrozen` is enabled (#152354)](#152354) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Anton Dosov","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-03-08T12:26:16Z","message":"Fix csv generation when `search:includeFrozen` is enabled (#152354)\n\nfix https://github.com/elastic/kibana/issues/151546\r\nsee: https://github.com/elastic/kibana/issues/151546#issuecomment-1443996912\r\n\r\n\r\nSince it isn't possible to freeze an index in 8.x to test you have to\r\ncreate an index and freeze it in 7.x and then upgrade to 8.x.","sha":"00e0f5cae3911fec2491d3bba7684365fe74fdb5","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Reporting","Team:SharedUX","backport:prev-minor","v8.8.0"],"number":152354,"url":"https://github.com/elastic/kibana/pull/152354","mergeCommit":{"message":"Fix csv generation when `search:includeFrozen` is enabled (#152354)\n\nfix https://github.com/elastic/kibana/issues/151546\r\nsee: https://github.com/elastic/kibana/issues/151546#issuecomment-1443996912\r\n\r\n\r\nSince it isn't possible to freeze an index in 8.x to test you have to\r\ncreate an index and freeze it in 7.x and then upgrade to 8.x.","sha":"00e0f5cae3911fec2491d3bba7684365fe74fdb5"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/152354","number":152354,"mergeCommit":{"message":"Fix csv generation when `search:includeFrozen` is enabled (#152354)\n\nfix https://github.com/elastic/kibana/issues/151546\r\nsee: https://github.com/elastic/kibana/issues/151546#issuecomment-1443996912\r\n\r\n\r\nSince it isn't possible to freeze an index in 8.x to test you have to\r\ncreate an index and freeze it in 7.x and then upgrade to 8.x.","sha":"00e0f5cae3911fec2491d3bba7684365fe74fdb5"}}]}] BACKPORT--> Co-authored-by: Anton Dosov <[email protected]>
…2354) fix elastic#151546 see: elastic#151546 (comment) Since it isn't possible to freeze an index in 8.x to test you have to create an index and freeze it in 7.x and then upgrade to 8.x.
Summary
fix #151546
see: #151546 (comment)
Since it isn't possible to freeze an index in 8.x to test you have to create an index and freeze it in 7.x and then upgrade to 8.x.