Version: 5.4
I'm trying to use reindex to make a minor change to a mapping, although the mapping itself is complex and contains custom analyzer/tokenizers.
Reindex works if I don't create the new mapping first:
POST _reindex
{
"source": {
"index": "cheminfo",
"size": 1
},
"dest": {
"index": "cheminfo_temp",
"version_type": "external"
}
}
But if I create the "cheminfo_temp" mapping first (even if exactly the same as the source mapping). It fails with an IndexOutOfBoundsException somewhere deep inside InternalEngine.java
[2018-09-13T11:41:07,393][DEBUG][o.e.a.b.TransportShardBulkAction] [elspoc-node1] [cheminfo_temp][0] failed to execute bulk item (index) BulkShardRequest [[cheminfo_temp][0]] containing [index {[cheminfo_temp][docs][a7612d2d7834814b6a55f3488747049], source[n/a, actual length: [10.6kb], max length: 2kb]}]
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[?:1.8.0_121]
at java.util.ArrayList.get(ArrayList.java:429) ~[?:1.8.0_121]
at org.elasticsearch.index.engine.InternalEngine.index(InternalEngine.java:639) ~[elasticsearch-5.4.1.jar:5.4.1]
at org.elasticsearch.index.engine.InternalEngine.indexIntoLucene(InternalEngine.java:583) ~[elasticsearch-5.4.1.jar:5.4.1]
at org.elasticsearch.index.engine.InternalEngine.index(InternalEngine.java:483) ~[elasticsearch-5.4.1.jar:5.4.1]
at org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:560) ~[elasticsearch-5.4.1.jar:5.4.1]
...
One thing I noticed is that the source length is larger than the max of 2Kb, can 2Kb really be the max? In any case, I think the real problem lies in the creation of the new mapping first. The mapping contains custom tokenizers that have to be renamed or a conflict arises. Could that make reindex throw an IndexOutOfBoundsException?
I'll post the complete mapping in a follow up since it will exceed the allowed length...