Deleting Data in InfluxDB2 fails

Hi,
I have a problem regarding data deletion in InfluxDB2. I tried the command influx delete ... but this fails with the following error:

Error: Failed to delete data: unable to delete: cannot delete data. DB contains shards using both inmem and tsi1 indexes. Please convert all shards to use the same index type to delete data.: cannot delete data. DB contains shards using both inmem and tsi1 indexes. Please convert all shards to use the same index type to delete data.
See 'influx delete -h' for help

How can I convert those indices? I found nothing in the docs. And the -h command is not helpful with this problem.

Secondary question: Does this happen due to the fact that I started collection data with InfluxDB1 and migrated this data? Or is this not related to the upgrade process?

Hi @chris_b
I don’t know why there is two type of index in your influxdb, but there is a doc for better memory management in this link. The point is it shows how to convert indexes to tsi1.
I hope it helps you.

Hi,
thanks for your reply. Unfortunately influx_inspect buildtsi is not available on InfluxDB 2.x and I didn’t manage to find any equivalent.

did you upgrade your instance from v1? InfluxDB v2 only possesses the tsi1 style index.

Hi @tim.hall,
That’s correct, I upgraded from v1. Any idea what I can do now to solve my problem?

Thanks

@chris_b you might be able to get by for now by setting the index-version config key to "inmem" (you could also set INFLUXD_INDEX_VERSION=inmem in the env, or pass --index-version inmem when you run influxd)

The good news is that we’ve already identified & fixed the issue, to be included in the upcoming 2.0.4 release. The fix is going to truly remove the “inmem” index option, and include logic to rebuild missing TSI indexes on startup when needed.

Hey @dan-moran ,
thanks for replying! That sounds like good news. I have no pressure to delete the affected data so I will happily wait for the 2.0.4 release :slight_smile:

should be available now @chris_b

Downloads (influxdata.com)