Skip to content
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

[Bug] QueryResult parsing fails on node labels retrieval on read only replicas #74

Open
marcinc opened this issue Oct 6, 2022 · 0 comments

Comments

@marcinc
Copy link

marcinc commented Oct 6, 2022

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:

values[idx] = qr.parseNode(c)
labels[i] = qr.graph.getLabel(labelIds[i])

Turned out the Labels() calls procedure internally

redisgraph-go/graph.go

Lines 283 to 284 in 3b0ad09

func (g *Graph) Labels() []string {
qr, _ := g.CallProcedure("db.labels", nil)
which disregards the mode for that procedure and always attempts to run RW g.Query(q) which will obviously fail on read-only replicas.

return g.Query(q)

I'm happy to submit a PR for this issue as I've already solved it in my current project.

@marcinc marcinc changed the title QueryResult parsing fails on node labels retrieval on read only replicas [Bug] QueryResult parsing fails on node labels retrieval on read only replicas Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant