Skip to content

Incremental bulk integration with rest layer#112154

Merged
Tim-Brooks merged 27 commits intoelastic:partial-rest-requestsfrom
Tim-Brooks:incremental_bulk_rest
Aug 30, 2024
Merged

Incremental bulk integration with rest layer#112154
Tim-Brooks merged 27 commits intoelastic:partial-rest-requestsfrom
Tim-Brooks:incremental_bulk_rest

Conversation

@Tim-Brooks
Copy link
Copy Markdown
Contributor

@Tim-Brooks Tim-Brooks commented Aug 23, 2024

Integrate the incremental bulks into RestBulkAction

@Tim-Brooks Tim-Brooks added >non-issue :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. v8.16.0 labels Aug 23, 2024
@Tim-Brooks Tim-Brooks changed the base branch from main to partial-rest-requests August 23, 2024 15:03
@Tim-Brooks Tim-Brooks marked this pull request as ready for review August 28, 2024 04:41
@Tim-Brooks Tim-Brooks requested a review from a team as a code owner August 28, 2024 04:41
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Meta label for distributed team. label Aug 28, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

assertResponseException(responseException, "request body is required");
}

@AwaitsFix(bugUrl = "need to decide how to handle this scenario")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have this change in my draft of HttpObjectAggregator removal. It should address no-content partially, for known length I use content-length header, for chunked there is no way to tell so it's always true.

https://github.com/elastic/elasticsearch/pull/112120/files#diff-b6d89d18f95a49d731741f926ee22d01f0dd8039de82382e68c1862e19f22b04R282-R297

Copy link
Copy Markdown
Contributor

@mhl-b mhl-b left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

No blocking comments from me, but also did not do a full review. Feel free to merge based on other's reviews.

final HttpObjectAggregator aggregator = new Netty4HttpAggregator(
handlingSettings.maxContentLength(),
httpPreRequest -> enabled.get() == false
|| (httpPreRequest.uri().contains("_bulk") == false || httpPreRequest.uri().contains("_bulk_update"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we make this:

Suggested change
|| (httpPreRequest.uri().contains("_bulk") == false || httpPreRequest.uri().contains("_bulk_update"))
|| (httpPreRequest.uri().endsWith("/_bulk") == false && httpPreRequest.uri().contains("/_bulk?") == false)

instead? Seems slightly safer than the anti test for _bulk_update

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think the uri in this scenario contains query params. But I will look into this. This particular piece of work is quite unfortunate and hopefully we can find a better way either resolving the handler (doing full path analysis) earlier or if we change how we do all aggregation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is even another route that I am having to handle now (old: /_xpack/monitoring/_bulk).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

final HttpObjectAggregator aggregator = new Netty4HttpAggregator(handlingSettings.maxContentLength());
final HttpObjectAggregator aggregator = new Netty4HttpAggregator(
handlingSettings.maxContentLength(),
httpPreRequest -> enabled.get() == false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not entirely sure of the importance of this being in sync with the enabled flag checked in the rest-bulk-handler. However, it seems they could flip at different times, since we register these independently and they each add a listener for cluster settings. I wonder if we can fix that. I realize it is only an issue when turning it on/off, but would be nice to fix anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added a comment to the feature flag ticket and will address it as a follow-up. I agree with the concern.

https://elasticco.atlassian.net/browse/ES-9262

@Tim-Brooks Tim-Brooks merged commit 649ee4e into elastic:partial-rest-requests Aug 30, 2024
Tim-Brooks added a commit that referenced this pull request Sep 17, 2024
Integrate the incremental bulks into RestBulkAction
Tim-Brooks added a commit that referenced this pull request Sep 18, 2024
Integrate the incremental bulks into RestBulkAction
Tim-Brooks added a commit that referenced this pull request Sep 18, 2024
Integrate the incremental bulks into RestBulkAction
Tim-Brooks added a commit to Tim-Brooks/elasticsearch that referenced this pull request Sep 19, 2024
Integrate the incremental bulks into RestBulkAction
Tim-Brooks added a commit that referenced this pull request Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >non-issue Team:Distributed Meta label for distributed team. v8.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants