I am using ioredis to run a metrics interval function that executes two queries against Redis. I am using sentinel with one master and two slave nodes and this metric function always connects to a slave node. RediSearch version
const dbSize = await redis.dbsize();
const indexSize = await redis.call("FT.SEARCH", "devices", "*", "LIMIT", 0, 0);
The first query never has an issue, but occasionally the FT.SEACH query will return a record ending with 99 (eg. 399 or 199). The two queries should always match but randomly we get a bad response from the FT.SEARCH and when it starts happening it’s not 100%.
I have noticed that re-building the index temporarily solves this issue but I am not sure what the source of the issue is since there are no records in Redis that do not have all the required indexed fields.
Is the *99 response a signal when we hit a Redis Global Lock or is the RediSearch query running into an issue?
If it is a concurrency issue, are there any docs/ examples you can point me to so I can detect/ avoid any potential querying issues?