Race condition following delete operation

Some details, iOS, SwiftUI app using the Swift Influx API, Influx hosted on an Influx cloud instance by Influx.

Noticed I get incomplete flux records following a delete operation. Figuring I would rely on the database as the sole source of truth, I immediately repeat the query following a delete operation to update the current view (which should now have one less row in the list as one as been deleted).

But I noticed some strange results and found that the query returns partial results from the deleted record for a short while. I found that waiting 0.5 seconds to perform the query would resolve this or I can check the flux record values to see if the number of values is less than expected and just discard this record.

Neither seems ideal and perhaps I am in over my head on how queries work following a deletion of an Influx record - any ideas or comments are welcome.

Hello @sillygoose,
InfluxDB organizes data into shards and sometimes this causes delays.

Also InfluxDB was made to prioritize reads and writes over deletes based on the assumption that those collecting time sensitive data rarely perform deletes or updates. Fwiw :slight_smile:

Thank you for confirming my suspicions. I just went and deleted my local copy and everything works as expected.