Skip to content
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

Better logic on sending mapping update new type introduction #6669

Closed
wants to merge 5 commits into from

Conversation

kimchy
Copy link
Member

@kimchy kimchy commented Jul 1, 2014

when an indexing request introduces a new mapping, today we rely on the parsing logic to mark it as modified on the "first" parsing phase. This can cause sending of mapping updates to master even when the mapping has been introduced in the create index/put mapping case, and can cause sending mapping updates without needing to.
This bubbled up in the disabled field data format test, where we explicitly define mappings to not have the update mapping behaviour happening, yet it still happens because of the current logic, and because in our test we delay the introduction of any mapping updates randomly, it can get in and override updated ones.

when an indexing request introduces a new mapping, today we rely on the parsing logic to mark it as modified on the "first" parsing phase. This can cause sending of mapping updates to master even when the mapping has been introduced in the create index/put mapping case, and can cause sending mapping updates without needing to.
 This bubbled up in the disabled field data format test, where we explicitly define mappings to not have the update mapping behavior happening, yet it still happens because of the current logic, and because in our test we delay the introduction of any mapping updates randomly, it can get in and override updated ones.
closes elastic#6669
@@ -89,19 +91,55 @@ public void test() throws Exception {
}
}

private void updateFormat(String format) throws Exception {
private void updateFormat(final String format) throws Exception {
System.out.println(">> put mapping start " + format);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional or just debug leftovers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aye, should go to logger, will change

@@ -399,10 +400,10 @@ public DocumentMapper documentMapper(String type) {
return mappers.get(type);
}

public DocumentMapper documentMapperWithAutoCreate(String type) {
public Tuple<DocumentMapper, Boolean> documentMapperWithAutoCreate(String type) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add quick documentation of what the boolean in the tuple means?

@kimchy
Copy link
Member Author

kimchy commented Jul 1, 2014

@jpountz applies you suggestions

@jpountz
Copy link
Contributor

jpountz commented Jul 2, 2014

I just beasted DisabledFieldDataFormatTests with your patch and interestingly, I cannot reproduce the failure anymore when there are no replicas. However, if the number of replicas is one or more, then the failure gets easy to reproduce again.

@kimchy
Copy link
Member Author

kimchy commented Jul 2, 2014

@jpountz that was a test failure, we need to make sure the search request ends up properly loading field data on all copies of the shards, I pushed a fix

resp = client().prepareSearch("test").setPreference(Integer.toString(i)).addAggregation(AggregationBuilders.terms("t").field("s")
.collectMode(aggCollectionMode)).execute().actionGet();
assertFailures(resp);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I'm unhappy with is that the test will pass if any of these requests fails while I'd like to make sure that they all fail (if a SearchPhaseExecutionException is thrown)?

@jpountz
Copy link
Contributor

jpountz commented Jul 2, 2014

Good point. The change looks good to me now, can you just fix the handling of the SearchPhaseExecutionException and the formatting of the mappings when pushing?

@jpountz
Copy link
Contributor

jpountz commented Jul 2, 2014

LGTM. I beasted it and had no failure this time.

@kimchy kimchy closed this in ccd54da Jul 2, 2014
kimchy added a commit that referenced this pull request Jul 2, 2014
when an indexing request introduces a new mapping, today we rely on the parsing logic to mark it as modified on the "first" parsing phase. This can cause sending of mapping updates to master even when the mapping has been introduced in the create index/put mapping case, and can cause sending mapping updates without needing to.
 This bubbled up in the disabled field data format test, where we explicitly define mappings to not have the update mapping behavior happening, yet it still happens because of the current logic, and because in our test we delay the introduction of any mapping updates randomly, it can get in and override updated ones.
closes #6669
@kimchy kimchy deleted the better_new_mapper_update branch July 2, 2014 15:32
@clintongormley clintongormley changed the title better logic on sending mapping update new type introduction Mapping: Better logic on sending mapping update new type introduction Jul 16, 2014
@clintongormley clintongormley added the :Search/Mapping Index mappings, including merging and defining field types label Jun 7, 2015
@clintongormley clintongormley changed the title Mapping: Better logic on sending mapping update new type introduction Better logic on sending mapping update new type introduction Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Mapping Index mappings, including merging and defining field types v1.3.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants