Update API: Add noop field to response#9736
Conversation
Conflicts: src/main/java/org/elasticsearch/rest/action/update/RestUpdateAction.java
|
What concerns me about this pull request is that it adds to the REST API sometimes that is an implementation detail of updates. Can you give more content about your use-case, maybe it could be fixed in a different way? |
|
I just realised I didn't mention the issue where we talked about this #9642 In short, we get a huge amount of updates coming in that are noop. It's out of our hands, so when we changed to the update api with noop we dropped from ~60 indexes per second to <10. Now we want to renormalise data even more (across two types) and that would mean a scroll and scan with bulk update when the data changes. Since we don't want to do this on a noop, it'd be great to know when an update is a noop. |
|
This makes sense to me. If we go ahead and get it in, we need to serialize the new noop field ( |
|
@snikch are you interested in providing the extra bits that @javanna asked for here: #9736 (comment) |
|
@clintongormley Yup, I can get that sorted. Sorry, work's been full on - will have time over the next week or two. Cheers. |
|
What version is this expected to be released? |
|
Is this going to be merged for next release? thanks! |
There was a problem hiding this comment.
I suspect we need version checking for this unless its just going into 2.0
|
I suspect it'd be good to have a test in the Java api too. Sorry I didn't get those pings back in February. I'm going to go and tweak my gmail rules.... |
|
Also, just quickly scanning the diff - I suspect this might work for scripted updates as well. It'd be cool to add a test for that. Even if the test shows it doesn't work for scripted updates it'd be useful. |
And it turns out there isn't a way to add a special label to emails in which I'm pinged.... sadface |
|
Thanks Nik - I'll have a look at adding tests as per your comments. Is the version checking you mention the elasticsearch version (so support compatibility between clients which don't send the same data I guess?). If so (or not) can you point me in the direction of an example in the codebase currently? |
|
@snikch have a look at NodesHotThreadsRequest - it does the version checking on read and write. The idea is that when you have two versions of Elasticsearch running in the cluster you don't want them to not understand eachother - both for clients and during a rolling upgrade. |
|
I'd target this at 2.0 only, so no need for the version checks. |
|
Cool thanks @clintongormley. So just Unit tests required. |
|
In light of #11684 it might be nice to generalise this response a bit, so instead of just noop: true/false, perhaps: |
There was a problem hiding this comment.
instead of a boolean for noop, it would be better if we can have opcode, so that the client can know if it is indexed, deleted or noop
|
Hi everyone, any hint about the ES version that will contain this feature? |
Given the conversation above - 2.0 or later most probably. |
|
@snikch Are you interested in picking this up again? |
|
Yup, sure. Somehow I missed the whole conversation about opcodes. |
|
Hiya @snikch Just a ping to remind you about this :) |
|
Thanks @clintongormley. I started on this and ran into an issue. Previously we were binary Some guidance would be much appreciated from anybody who can help. I've just pushed up my work in progress. |
|
Ok @snikch! I'd start this by making the following change: And then playing whack-a-mole with errors for a while. That is a real nice way to do java spelunking because my IDE just tells me what to do next and all those changes are pretty mechanical. Next I'd add: to You'd need to add an operation field to UpdateResponse because it can contain any operation but the other responses can just use the data we have. I wouldn't worry about backwards compatibility here though. I'd just target master so it'll be in 3.0.0. After that you can probably do I'd likely remove all the from After that I'd hunt down the things that can be removed from the subclass overrides of Full disclosure: I probably wouldn't do it in this order but I think this is the right order to do it in. I started trying to implement this myself and bumbled around for 20 minutes before I figured out the order I'd go about it. And I'm used to this code. |
|
No further feedback. Closing |
|
So is this feature not forthcoming? Or did I miss something in reading through this thread? |
It is not. It was closed. |
|
If someone were to finish the development on this, would it be reconsidered? |
|
Sure. We never rejected the feature, just asked for changes to the
|
Adds a boolean field
_noopto Update API responses that indicates whether the update was a no-op or not.Closes #9642