mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
# Backport This will backport the following commits from `main` to `8.7`: - [Fix csv generation when `search:includeFrozen` is enabled (#152354)](https://github.com/elastic/kibana/pull/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":"anton.dosov@elastic.co"},"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 <anton.dosov@elastic.co>
This commit is contained in:
parent
e70452f969
commit
9428e82bc6
2 changed files with 17 additions and 3 deletions
|
@ -819,11 +819,20 @@ it('can override ignoring frozen indices', async () => {
|
|||
|
||||
await generateCsv.generateData();
|
||||
|
||||
expect(mockEsClient.asCurrentUser.openPointInTime).toHaveBeenCalledWith(
|
||||
{
|
||||
ignore_unavailable: true,
|
||||
ignore_throttled: false,
|
||||
index: 'logstash-*',
|
||||
keep_alive: '30s',
|
||||
},
|
||||
{ maxRetries: 0, requestTimeout: '30s' }
|
||||
);
|
||||
|
||||
expect(mockDataClient.search).toBeCalledWith(
|
||||
{
|
||||
params: {
|
||||
body: {},
|
||||
ignore_throttled: false,
|
||||
},
|
||||
},
|
||||
{ strategy: 'es', transport: { maxRetries: 0, requestTimeout: '30s' } }
|
||||
|
|
|
@ -66,6 +66,12 @@ export class CsvGenerator {
|
|||
index: indexPatternTitle,
|
||||
keep_alive: duration,
|
||||
ignore_unavailable: true,
|
||||
// TODO: currently this doesn't do anything as es has a bug that throttled indices are always included when using PIT api
|
||||
// if es fixes the issue, everything should work as expected. Just needs to be tested and this comment removed
|
||||
// if es decides to not fix, then we can close the issue and remove the `ignore_throttled` code from here
|
||||
// https://github.com/elastic/kibana/issues/152884
|
||||
// @ts-expect-error ignore_throttled is not in the type definition, but it is accepted by es
|
||||
ignore_throttled: settings.includeFrozen ? false : undefined, // "true" will cause deprecation warnings logged in ES
|
||||
},
|
||||
{
|
||||
requestTimeout: duration,
|
||||
|
@ -91,7 +97,7 @@ export class CsvGenerator {
|
|||
settings: CsvExportSettings,
|
||||
searchAfter?: estypes.SortResults
|
||||
) {
|
||||
const { scroll: scrollSettings, includeFrozen } = settings;
|
||||
const { scroll: scrollSettings } = settings;
|
||||
searchSource.setField('size', scrollSettings.size);
|
||||
|
||||
if (searchAfter) {
|
||||
|
@ -112,7 +118,6 @@ export class CsvGenerator {
|
|||
const searchParams = {
|
||||
params: {
|
||||
body: searchBody,
|
||||
ignore_throttled: includeFrozen ? false : undefined, // "true" will cause deprecation warnings logged in ES
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue