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

Increase UI reactiveness on folders manual upserts #11496

Merged
merged 24 commits into from
Mar 20, 2025
Merged

Conversation

aubin-tchoi
Copy link
Contributor

@aubin-tchoi aubin-tchoi commented Mar 20, 2025

Description

Tests

  • Tested locally.

Risk

  • High but will be monitored here.

Deploy Plan

  • Run 20250320_reduce_refresh_interval.http.

Comment on lines 1147 to 1148
true => Refresh::True,
false => Refresh::False,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@flvndvd any insight on the impact of this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering about the intended use case here, is the goal to run this every time someone upserts a document from the UI?

If so, Elasticsearch generally isn't designed for this approach. The refresh operation does come with some performance overhead (which is why the default is set to 30 seconds).

Perhaps we could explore a middle ground? We could try reducing the current refresh interval to a lower threshold that still meets your needs while being mindful of performance.

One other consideration, this implementation might allow multiple refresh operations to start simultaneously, which could potentially impact performance.

Copy link
Contributor

@philipperolet philipperolet left a comment

Choose a reason for hiding this comment

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

Code looks good, but a bit wary of letting people use force_refresh in the code. Force refresh causes heavy I/O, segments merging overhead, and memory pressure as far as I can read.

Maybe it would be better to try with a simple change of refresh_interval to 5s first?
awaiting your opinion @flvndvd

@@ -1840,6 +1840,8 @@ struct DataSourcesDocumentsUpsertPayload {
title: String,
mime_type: String,
provider_visibility: Option<ProviderVisibility>,
// Force an ES refresh upon indexation to make the node searchable immediately.
force_refresh: Option<bool>,
Copy link
Contributor

Choose a reason for hiding this comment

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

force_search_index_refresh is more explicit I think

Copy link
Contributor

@spolu spolu left a comment

Choose a reason for hiding this comment

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

Deferring final review to ES expects. Left a nit on naming. LGTM otherwise \o/

@aubin-tchoi aubin-tchoi changed the title Force ES index refresh upon document upsert in folder Increase UI reactiveness on folders manual upserts Mar 20, 2025
Copy link
Contributor

@philipperolet philipperolet left a comment

Choose a reason for hiding this comment

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

👍 🙏

@aubin-tchoi aubin-tchoi merged commit 93ec80a into main Mar 20, 2025
8 checks passed
@aubin-tchoi aubin-tchoi deleted the refresh-es branch March 20, 2025 12:11
Copy link
Contributor

@flvndvd flvndvd left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants