Remove type field from DocWriteRequest and associated Response objects#47671
Remove type field from DocWriteRequest and associated Response objects#47671romseygeek merged 43 commits intoelastic:masterfrom
Conversation
…ction' into types-removal/bulk-request-action
You're right, I got confused by things not being deprecated on |
jtibshirani
left a comment
There was a problem hiding this comment.
What a big effort! This looks good to me, I just left a couple questions/ comments.
| { | ||
| "_index": "index", | ||
| "_id": "1", | ||
| "_type": "_doc", |
There was a problem hiding this comment.
Should we leave this reference untouched, since it is supposed to describe the 7.x behavior? To avoid test failures, we could mark these snippets as not tested (as we do for some of the snippets that only make sense in 6.x).
There was a problem hiding this comment.
Possibly, although I imagine we will remove this page entirely, and instead have something in the upgrade notes - @colings86 @jpountz do you have an opinion on what to do here?
| * Sets the type of the document to delete. | ||
| * @deprecated types are being removed | ||
| */ | ||
| @Deprecated |
There was a problem hiding this comment.
It sounds like these methods will be removed in a follow-up PR?
| policies = entityAsMap(response); | ||
| } catch (ResponseException e) { | ||
| if (RestStatus.METHOD_NOT_ALLOWED.getStatus() == e.getResponse().getStatusLine().getStatusCode()) { | ||
| if (RestStatus.METHOD_NOT_ALLOWED.getStatus() == e.getResponse().getStatusLine().getStatusCode() || |
There was a problem hiding this comment.
Looks like some leftover code to work around test failures?
There was a problem hiding this comment.
So this was an interesting one; all the REST tests started failing with 400 errors, and it took me a while to track down what was happening. Previously, if SLM or ILM were not enabled, a call to GET _ilm/policy would be interpreted as an index matching {index}/{type}, which only has handlers registered for PUT and POST, and so would return a 406 Method not allowed error. Now, the {index}/{type} handler has gone away, and so we just get a 400 Bad Request instead. I don't think we need to check for 406 errors any more, so I'll try removing that line.
There was a problem hiding this comment.
Looks like we still need to check for both due to BWC checks
There was a problem hiding this comment.
Got it, this change makes sense to me.
| final Translog.Operation[] operations = ShardChangesAction.getOperations(indexShard, indexShard.getLastKnownGlobalCheckpoint(), | ||
| 0, 12, indexShard.getHistoryUUID(), new ByteSizeValue(256, ByteSizeUnit.BYTES)); | ||
| assertThat(operations.length, equalTo(12)); | ||
| assertThat(operations.length, equalTo(11)); |
There was a problem hiding this comment.
For my context, why did this number change?
There was a problem hiding this comment.
The test is checking what happens when documents stored in the translog take up more than a certain amount of space, in this case 256 bytes. Previously, the documents had a type of doc, but now they have a type of _doc (as a default - a future PR will remove type entirely from the doc stored in the translog), which is one byte longer, so we fit one fewer document in the same number of bytes.
There was a problem hiding this comment.
Thanks for the explanation.
We still need to check for 405 errors during mixed-cluster BWC tests This reverts commit ed1f3fd.
jtibshirani
left a comment
There was a problem hiding this comment.
This looks good to me, apart from the question around removal_of_types.asciidoc.
|
Thanks @jtibshirani - I added an item to the meta issue to discuss what to do about the |
elastic#47671) This commit removes the type field from index, update and delete requests, and their associated responses. Relates to elastic#41059
…tDeleteAction the previously removed typed enpotins for Update and Delete are retrofitted in this commit the commit that removed them elastic#47671 relates main meta issue elastic#51816 relates types removal issue elastic#54160
This commit removes the
typefield from index, update and delete requests, and theirassociated responses.
Relates to #41059