Unable to tesselate shape leads to the collapse of the active index

Today we encountered a problem with our search_contacts_v1-0-5 index on dev-cluster (I named index and cluster so it might help to identify some logs for MongoDB employee)

What has happened is index suddenly appeared in a failed state even though there were any interactions with it except new data was added. I would understand if index remained in Failed state until the incorrect shape is detected and fixed/deleted, so I started the creation of a duplicate index to verify this.
As a result, both indexes were in Active condition in a few moments.

I can not find any alerts or log with additional description, can someone have a look at it?
Can we set any alert so we are aware if Search Index accidentally fails?
I also believe, index should not collapse if the shape is incorrect, so it might be a bug.

1 Like

Hi Stanislav,

The current behavior is: the mongot will crash with the following trace on this error:

java.lang.IllegalArgumentException: Unable to Tessellate shape. Possible malformed shape detected.
	at org.apache.lucene.geo.Tessellator.earcutLinkedList(Tessellator.java:575)
	at org.apache.lucene.geo.Tessellator.tessellate(Tessellator.java:139)
	at org.apache.lucene.geo.Tessellator.tessellate(Tessellator.java:89)
	at org.apache.lucene.document.LatLonShape.createIndexableFields(LatLonShape.java:102)
	at org.apache.lucene.document.LatLonShape.createIndexableFields(LatLonShape.java:86)

I just merged a fix for this and the new behavior is: the index process will not crash on the Tesselate exception. The index process will skip the invalid geometry field and log a warning with this warning msg: “Error converting a LeafGeometry to a Lucene Field. fieldName %s”.

This behavior will show up in the next Atlas Release.