[discourse] Multiple Flipt instances are not working properly #4330
-
Originally posted by weibin on Discourse Hi team! We are using Flipt in our project and it works great, but we recently ran into an issue. When multiple Flipt instances are deployed in Kubernetes, only one instance can correctly evaluate the variant. The other instances will return
The We are deploying Flipt on Kubernetes using a Helm chart, and we have enabled autoscaling. This is the log that can evaluate the variant, and I noticed that there is a This is the log that can not evaluate the variant, with When we scale it down to one instance, it can correctly evaluate the variant. This is the rule and variants for the flag I would appreciate your assistance. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This issue is likely caused by synchronization delays or cache inconsistencies between your Flipt instances. Flipt uses a versioned caching mechanism with Redis to keep state in sync across replicas. When a flag, rule, or variant changes, the namespace version is incremented, invalidating the cache for that namespace and forcing a refresh on the next read. However, if one instance updates the state and others haven't yet refreshed their cache (due to TTL or propagation delay), you can see symptoms like "no distributions for rule" and empty variant results on some pods, while others work as expected. In the worst case, this staleness can persist for up to the cache TTL, but it's usually brief and self-healing once the cache expires or is invalidated by a write operation. PostgreSQL remains the source of truth, so eventual consistency is guaranteed as long as all instances share the same Redis and database backends [source]. To minimize these issues, make sure:
If you continue to see persistent cache inconsistencies, check your Redis logs for errors or missed cache invalidations, and verify that all Flipt pods are using the same configuration and environment variables. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
Reply from erka on Discourse: The original discussion and all details could be found in Discord thread |
Beta Was this translation helpful? Give feedback.
Reply from erka on Discourse:
The original discussion and all details could be found in Discord thread