From 6a84cccbdeb801b99e2d6fe62a976f994aa429c2 Mon Sep 17 00:00:00 2001 From: Anton Dosov Date: Thu, 2 Jan 2025 18:45:08 +0100 Subject: [PATCH] =?UTF-8?q?[Reporting]=20don=E2=80=99t=20wait=20for=20refr?= =?UTF-8?q?esh=20when=20uploading=20a=20chunk=20(#204775)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary close https://github.com/elastic/kibana-team/issues/1367 We saw significant slowness when uploading large CSV files in serverless. This PR should speed this up. Initially wait_for was introduced to reduce test flakiness https://github.com/elastic/kibana/pull/176022#discussion_r1511001636, but it seems it can be safely removed from uploading stream chunks Co-authored-by: Elastic Machine --- x-pack/plugins/reporting/server/lib/content_stream.test.ts | 4 ---- x-pack/plugins/reporting/server/lib/content_stream.ts | 2 -- 2 files changed, 6 deletions(-) diff --git a/x-pack/plugins/reporting/server/lib/content_stream.test.ts b/x-pack/plugins/reporting/server/lib/content_stream.test.ts index 6d3fccff0b91a..91ab3953aa8a9 100644 --- a/x-pack/plugins/reporting/server/lib/content_stream.test.ts +++ b/x-pack/plugins/reporting/server/lib/content_stream.test.ts @@ -300,7 +300,6 @@ describe('ContentStream', () => { id: expect.any(String), index: '.kibana-reporting', op_type: 'create', - refresh: 'wait_for', body: { '@timestamp': '1970-01-01T00:00:00.000Z', parent_id: 'something', @@ -317,7 +316,6 @@ describe('ContentStream', () => { id: expect.any(String), index: '.kibana-reporting', op_type: 'create', - refresh: 'wait_for', body: { '@timestamp': '1970-01-01T00:00:00.000Z', parent_id: 'something', @@ -348,7 +346,6 @@ describe('ContentStream', () => { id: expect.any(String), index: '.kibana-reporting', op_type: 'create', - refresh: 'wait_for', body: { parent_id: 'something', '@timestamp': '1970-01-01T00:00:00.000Z', @@ -365,7 +362,6 @@ describe('ContentStream', () => { id: expect.any(String), index: '.kibana-reporting', op_type: 'create', - refresh: 'wait_for', body: { parent_id: 'something', '@timestamp': '1970-01-01T00:00:00.000Z', diff --git a/x-pack/plugins/reporting/server/lib/content_stream.ts b/x-pack/plugins/reporting/server/lib/content_stream.ts index b3c113dd43c3b..e5006a4a45268 100644 --- a/x-pack/plugins/reporting/server/lib/content_stream.ts +++ b/x-pack/plugins/reporting/server/lib/content_stream.ts @@ -192,7 +192,6 @@ export class ContentStream extends Duplex { const body = await this.client.update({ ...this.document, - refresh: 'wait_for', body: { doc: { output: { content }, @@ -212,7 +211,6 @@ export class ContentStream extends Duplex { await this.client.index({ id, index: REPORTING_DATA_STREAM_ALIAS, - refresh: 'wait_for', op_type: 'create', body: { parent_id: parentId,