-
Notifications
You must be signed in to change notification settings - Fork 25.6k
IndexAction to return DocWriteResponse #99964
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
IndexAction to return DocWriteResponse #99964
Conversation
|
cc @DaveCTurner - this seems to work, but it is pretty invasive, which makes me think maybe allowing IndexResponse to be a The REST status that should be returned when we just drop a document is something else I'm unsure of. At the moment we return |
DaveCTurner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Certainly a noisy change, but I wouldn't call it invasive - it's pretty superficial. I'm a little surprised that no callers cared what kind of response they're getting, but I don't see any here.
|
|
||
| private IndexAction() { | ||
| super(NAME, IndexResponse::new); | ||
| super(NAME, in -> { throw new UnsupportedOperationException(); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be safe we can preserve today's behaviour in prod whilst still failing tests if anyone calls this in future:
| super(NAME, in -> { throw new UnsupportedOperationException(); }); | |
| super(NAME, in -> { | |
| assert false : "might not be an IndexResponse!"; | |
| return new IndexResponse(in); | |
| }); |
I like this bikeshed the colour it is already :) RFC 2616 section 10.2.3 says: I don't think that fits our usage. |
…dex-action-response
|
Pinging @elastic/es-distributed (Team:Distributed) |
|
|
I've dug a little further in to what it is that's using the Writeable.Reader from ActionType, and it appears that the only real use is in the RemoteClusterAwareClient, which may use IndexRequest/Response as part of CCR? It isn't an area of the code I know well, so I wonder if we are in fact testing that CCR works with ingest pipelines that drop documents. |
Yes, I'm really keen to separate out the few remote-cluster actions that still need their requests & responses to be de/serializable so we can get rid of all this dead code (cc @ldematte). But no, CCR doesn't send single-doc indexing requests over the wire. |
|
@elasticmachine update branch |
DaveCTurner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@elasticmachine update branch |
IndexRequests can sometimes return an UpdateResponse rather than an IndexResponse if there is an ingest pipeline that drops documents. This commit changes IndexAction to return their common superclass DocWriteResponse.
IndexRequests can sometimes return an UpdateResponse rather than an IndexResponse if
there is an ingest pipeline that drops documents. This commit changes IndexAction to
return their common superclass DocWriteResponse.