The fid index file seems corrupted (some index are missing) after features deletion (using WFS-T call)

Description

I display my shapefile using Leaflet and I send a request to my geoserver in order to remove a feature (see the request below).
Everything is OK, my feature is well removed and my shapefile well updated.
But in fact, internally, the fid index file (XXX.fix) is corrupted because one index is now missing.
Therefore, if I select the feature that is missing in the XXX.fix file, I'm not able to update/delete it anymore: transactions are ignored and the WMS api returns OK but with wfs:totalInserted,wfs:totalUpdated and wfs:totalDeleted all equal to 0.

Technical investigations
The issue is coming from the geoserver sources (DeleteElementHandler.java), the instruction "store.getFeatures(filter).size()" returns 0 but should not.
After some digging, it's seems to come from geotools sources (IndexManager.java), the instruction "reader.findFid(fid)" should not return -1.
I provided a java file (IssueFidIndex.java) that helps me to investigate and to see what is in the file XXX.fix and wich index is missing.

Manual workaround
1) If I manually stop geoserver, remove the XXX.fix file and restart geoserver, then the index file is well regenerated with no more missing index.
2) Switch the value of fidIndexed in the file ShapefileDataStore.java (see details in comments)

Here comes the XML transaction sent through geoserver wms api in order to delete a feature (filtering by fid):

Environment

Using geoserver 2.11.1 and geotools 17.1
Using a "Directory of spatial files (shapefiles)" store
Using the shapefile provided by geoserver package (data_dir\data\shapefiles\states.shp)
OS: Windows 10

Status

Assignee

Ian Turton

Reporter

Alban44

Triage

Components

Fix versions

Affects versions

Priority

High
Configure