-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property data corruption after graph rebuild #86
Comments
Forgot to mention, if we query the graph on CLI, it returns the correct data.
|
@xujiaxj Thanks for reporting |
Looks like the JRedisGraph refreshes its local cache only if it detects a higher ID than the current max. Presumably, this indicates a new label/relationshipType/property is created. However, if we delete some entities and recreate a few in a way a smaller ID is reused, will we run into the same wrong mapping problem? From the code, it looks like it might. |
@xujiaxj |
Hi @DvirDukhan , it looks like we ran into this data corruption issue in our prod environment and it caused a complete outage. Looking at the metrics we collect from our redis subscriptions in the Redis Enterprise Cloud, we can see that all of the redis instances we are using were upgraded which triggered the issue. Despite the upgrade being made in all of our environments, the issue only occurred in our prod environment. The only difference being that there are more graphs in that env (5 total). Our dev environments have anywhere from 1-3. Another thing to note is that the only graph which had no corruption issues was the first graph created for that redis instance. The other 4 graphs that were created at later dates had problems. Only restarting our services communicating with redis resolved the corruption issue. Our subscription numbers are: We are running Thanks! |
RedisGraph version: 2.2.6
JRedisGraph version: 2.1.0
For simplicity, let's say we have two Java services talking to a RedisGraph server: one called GraphBuilder, the other called GraphQuerier. They both use JRedisGraph client. Our GraphBuilder has a timer task that builds a graph once every minute. We are using
MERGE
command, so it's essentially a timer task that keeps "upserting" the graph.Everything is on K8s. When the Redis server crashes, its pod will be restarted, and the graph will be gone, but the GraphBuilder will rebuild the graph in no time. When this happens, queries ran on the GraphQuerier can produce corrupted data. Particularly the property names are messed up.
For instance, if the GraphQuerier has not been restarted after Redis crash, it will print a list of properties with property names all messed up:
But if we restart the GraphQuerier, or deploy a new GraphQuerier pod, and query the same node on the same graph, we will get the correct result:
Note for some properties, we are storing Java data types like
String
as the values, so don't be confused there.The query we run to fetch the data is very simple, like
Is it that JRedisGraph client has some form of cached mapping from property ids to property names? If the graph is rebuilt, the mapping will be out-of-date.
We don't have a way to always restart all our services whenever the Redis restarts. So this kind of data corruption cracks the foundation our software is built on.
The text was updated successfully, but these errors were encountered: