Open marcinc opened 2 years ago
I noticed an issue with the QueryResult -> parseRecords logic when running a query against a redis read-only replica. Specific issue around Labels retrieval that it called internally when parsing a node: https://github.com/RedisGraph/redisgraph-go/blob/3b0ad0971fcab5b4f4b74d28974e774cf938e290/query_result.go#L143 https://github.com/RedisGraph/redisgraph-go/blob/3b0ad0971fcab5b4f4b74d28974e774cf938e290/query_result.go#L178
Turned out the Labels() calls procedure internally https://github.com/RedisGraph/redisgraph-go/blob/3b0ad0971fcab5b4f4b74d28974e774cf938e290/graph.go#L283-L284 which disregards the mode for that procedure and always attempts to run RW g.Query(q) which will obviously fail on read-only replicas.
Labels()
g.Query(q)
https://github.com/RedisGraph/redisgraph-go/blob/3b0ad0971fcab5b4f4b74d28974e774cf938e290/graph.go#L279
I'm happy to submit a PR for this issue as I've already solved it in my current project.
I noticed an issue with the QueryResult -> parseRecords logic when running a query against a redis read-only replica. Specific issue around Labels retrieval that it called internally when parsing a node: https://github.com/RedisGraph/redisgraph-go/blob/3b0ad0971fcab5b4f4b74d28974e774cf938e290/query_result.go#L143 https://github.com/RedisGraph/redisgraph-go/blob/3b0ad0971fcab5b4f4b74d28974e774cf938e290/query_result.go#L178
Turned out the
Labels()
calls procedure internally https://github.com/RedisGraph/redisgraph-go/blob/3b0ad0971fcab5b4f4b74d28974e774cf938e290/graph.go#L283-L284 which disregards the mode for that procedure and always attempts to run RWg.Query(q)
which will obviously fail on read-only replicas.https://github.com/RedisGraph/redisgraph-go/blob/3b0ad0971fcab5b4f4b74d28974e774cf938e290/graph.go#L279
I'm happy to submit a PR for this issue as I've already solved it in my current project.