-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Disallow VersionType.FORCE
for GetRequest
#21079
Conversation
This doesn't make much sense to have at all, since a user can do a `GET` request without a version of they want to get it unconditionally. Relates to elastic#20995
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.
Looks good, but asked a question
@@ -101,6 +101,9 @@ public ActionRequestValidationException validate() { | |||
validationException = ValidateActions.addValidationError("illegal version value [" + version + "] for version type [" + versionType.name() + "]", | |||
validationException); | |||
} | |||
if (versionType == VersionType.FORCE) { |
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.
isn't this a problem if coming from an update request with force? should we do something there to enable this?
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.
I dunno, the more I think about this, more I think we should not have a hard check on this, with 6.0 it won't break anything on GET requests and I'm not sure the complexity is worth it, it can just be removed in 7.0 entirely.
What do you think?
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.
so to answer my own question - it's not a problem because the update request handling goes directly to the IndexShard - UpdateHelper#prepare(org.elasticsearch.action.update.UpdateRequest, org.elasticsearch.index.shard.IndexShard)
I think we should not have a hard check on this, with 6.0 it won't break anything on GET requests
I think this is still good to do? like we remove the FORCE
support from other API in 6.0?
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.
Ahh okay, if the UpdateHelper
doesn't use this then we should be able to block this with no problem.
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.
now it's official :D
VersionType.FORCE
for GetRequest
This doesn't make much sense to have at all, since a user can do a
GET
request without a version of they want to get it unconditionally.
Relates to #20995