Skip to content

Move required routing validation to IndexRouting#79472

Merged
elasticsearchmachine merged 13 commits intoelastic:masterfrom
nik9000:index_routing_from_source_clean_2
Oct 27, 2021
Merged

Move required routing validation to IndexRouting#79472
elasticsearchmachine merged 13 commits intoelastic:masterfrom
nik9000:index_routing_from_source_clean_2

Conversation

@nik9000
Copy link
Copy Markdown
Member

@nik9000 nik9000 commented Oct 19, 2021

Now that we have a place responsible for picking shards we can move the
"routing is required" validation there, right next to the validation for
the routing_path stuff. This feels like a more convenient place to
have it. Certainly a nice place to unit test it.

@nik9000 nik9000 added >non-issue :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. v8.0.0 labels Oct 19, 2021
@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team. label Oct 19, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

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

Now that we have a place responsible for picking shards we can move the
"routing is required" validation there, right next to the validation for
the `routing_path` stuff. This feels like a more convenient place to
have it. Certainly a nice place to unit test it.
@nik9000
Copy link
Copy Markdown
Member Author

nik9000 commented Oct 19, 2021

run elasticsearch-ci/part-1

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.

LGTM with one change. Thanks for improving this.

termVectorsRequest.id(), termVectorsRequest.routing());
} catch (Exception e) {
responses.set(i, new MultiTermVectorsItemResponse(null,
new MultiTermVectorsResponse.Failure(termVectorsRequest.index(), termVectorsRequest.id(), e)));
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 think this changes the way we report a missing routing to list the original request index (which could be an alias) rather than the concrete index. I think we want to report the concrete index here?

Same in TransportMultiGetAction.

I suppose one could argue that reporting the original index-name is just as good since the info is baked into the exception message. But it does open a discussion on this being a breaking change (though a very small one)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

But it does open a discussion on this being a breaking change (though a very small one)?

I don't think we consider error messages to be part of the semver contract. But changing it without thinking about it is not good. I'll have a closer look.

@nik9000
Copy link
Copy Markdown
Member Author

nik9000 commented Oct 27, 2021

@elasticmachine update branch

@nik9000 nik9000 added v8.1.0 auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) and removed v8.0.0 labels Oct 27, 2021
@nik9000 nik9000 force-pushed the index_routing_from_source_clean_2 branch from 0d1363d to 673d8bf Compare October 27, 2021 18:53
@elasticsearchmachine elasticsearchmachine merged commit 6741cbf into elastic:master Oct 27, 2021
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Nov 10, 2021
Now that we have elastic#79394 and elastic#79472 the switch statement in
`TransportBulkAction` is mostly just assigning routing and doing some
stuff with INDEX and UPDATE requests. This pulls the routing stuff into
a single call and calls out the index-only stuff. Now, at least, it's
clearer that only INDEX and UPDATE are special.
nik9000 added a commit that referenced this pull request Nov 11, 2021
Now that we have #79394 and #79472 the switch statement in
`TransportBulkAction` is mostly just assigning routing and doing some
stuff with INDEX and UPDATE requests. This pulls the routing stuff into
a single call and calls out the index-only stuff. Now, at least, it's
clearer that only INDEX and UPDATE are special.
@wchaparro wchaparro assigned nik9000 and unassigned nik9000 Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :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.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants