Got shard failure when i delete mapping for types

Hi all,
I'm testing delete mapping for types, but in a certain time i get shard
failure error. 1 shard goes to unassigned shard.

Scenario is like below:

  • put mappings for 15 different types
  • insert a couple of docs with 3 test fields for each types
  • delete all the mappings
  • repeat above test code again and again until i get the shard error

you may refer the code here. https://gist.github.com/mintbass/5675355

The error occured because 'no index mapper found for field' at
org.elasticsearch.index.codec.PerFieldMappingPostingFormatCodec class.
So, i modified a class to return the defaultPostingFormat value not to
throw an exception in
org.elasticsearch.index.codec.PerFieldMappingPostingFormatCodec.

@Override
public PostingsFormat getPostingsFormatForField(String field) {
    final FieldMappers indexName = mapperService.indexName(field);
    if (indexName == null) {
        //throw new ElasticSearchIllegalStateException("no index mapper 

found for field: [" + field + "]");
return defaultPostingFormat;
}
PostingsFormatProvider postingsFormat =
indexName.mapper().postingsFormatProvider();
return postingsFormat != null ? postingsFormat.get() :
defaultPostingFormat;
}

Is there any workaround to avoid this?
Could it be any problem the code i changed in the future? so far, i don't
see any problem.

Thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

May be you should wait for a Yellow cluster status after each cluster change call (remove index, create index, delete mapping...).

Could it help?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 30 mai 2013 à 06:39, Marcus Park mintbass@gmail.com a écrit :

Hi all,
I'm testing delete mapping for types, but in a certain time i get shard failure error. 1 shard goes to unassigned shard.

Scenario is like below:

  • put mappings for 15 different types
  • insert a couple of docs with 3 test fields for each types
  • delete all the mappings
  • repeat above test code again and again until i get the shard error

you may refer the code here. https://gist.github.com/mintbass/5675355

The error occured because 'no index mapper found for field' at org.elasticsearch.index.codec.PerFieldMappingPostingFormatCodec class.
So, i modified a class to return the defaultPostingFormat value not to throw an exception in org.elasticsearch.index.codec.PerFieldMappingPostingFormatCodec.

@Override
public PostingsFormat getPostingsFormatForField(String field) {
    final FieldMappers indexName = mapperService.indexName(field);
    if (indexName == null) {
        //throw new ElasticSearchIllegalStateException("no index mapper found for field: [" + field + "]");
        return defaultPostingFormat;
    }
    PostingsFormatProvider postingsFormat = indexName.mapper().postingsFormatProvider();
    return postingsFormat != null ? postingsFormat.get() : defaultPostingFormat;
}

Is there any workaround to avoid this?
Could it be any problem the code i changed in the future? so far, i don't see any problem.

Thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

hey,

On Thursday, May 30, 2013 6:39:48 AM UTC+2, Marcus Park wrote:

Hi all,
I'm testing delete mapping for types, but in a certain time i get shard
failure error. 1 shard goes to unassigned shard.

Scenario is like below:

  • put mappings for 15 different types
  • insert a couple of docs with 3 test fields for each types
  • delete all the mappings
  • repeat above test code again and again until i get the shard error

you may refer the code here. https://gist.github.com/mintbass/5675355

cool stuff that will help me to reproduce this.

The error occured because 'no index mapper found for field' at
org.elasticsearch.index.codec.PerFieldMappingPostingFormatCodec class.
So, i modified a class to return the defaultPostingFormat value not to
throw an exception in
org.elasticsearch.index.codec.PerFieldMappingPostingFormatCodec.

@Override
public PostingsFormat getPostingsFormatForField(String field) {
    final FieldMappers indexName = mapperService.indexName(field);
    if (indexName == null) {
        //throw new ElasticSearchIllegalStateException("no index 

mapper found for field: [" + field + "]");
return defaultPostingFormat;
}
PostingsFormatProvider postingsFormat =
indexName.mapper().postingsFormatProvider();
return postingsFormat != null ? postingsFormat.get() :
defaultPostingFormat;
}

I added the same thing like 6 days ago here:

you should be fine with your change - that is a bug though. the soon coming
0.90.1 release will fix the issue.

simon

Is there any workaround to avoid this?
Could it be any problem the code i changed in the future? so far, i don't
see any problem.

Thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.