-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Remove type field from DocWriteRequest and associated Response objects #47671
Remove type field from DocWriteRequest and associated Response objects #47671
Conversation
…ction' into types-removal/bulk-request-action
You're right, I got confused by things not being deprecated on |
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.
What a big effort! This looks good to me, I just left a couple questions/ comments.
@@ -532,7 +532,6 @@ PUT index/_doc/1 | |||
{ | |||
"_index": "index", | |||
"_id": "1", | |||
"_type": "_doc", |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
*/ | ||
@Deprecated |
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.
It sounds like these methods will be removed in a follow-up PR?
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.
++
@@ -684,7 +684,8 @@ private static void deleteAllILMPolicies() throws IOException { | |||
Response response = adminClient().performRequest(new Request("GET", "/_ilm/policy")); | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some leftover code to work around test failures?
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we still need to check for both due to BWC checks
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.
Got it, this change makes sense to me.
@@ -147,7 +147,7 @@ public void testGetOperationsExceedByteLimit() throws Exception { | |||
final IndexShard indexShard = indexService.getShard(0); | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my context, why did this number change?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation.
We still need to check for 405 errors during mixed-cluster BWC tests This reverts commit ed1f3fd.
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.
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
type
field from index, update and delete requests, and theirassociated responses.
Relates to #41059