-
Notifications
You must be signed in to change notification settings - Fork 59
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
NotALeader Errors #182
Comments
Hi @nixxholas, how are you connecting to the database, that is, which protocol? Do you use |
Greetings! I did both +s variants. The current workaround is to spam re-initialising Graph until the right routing is active. Even then, the connection can get routed wrongly, wondering what I should do next? I've had no success with directly targeting the write node. |
Is it an Aura db or something self hosted? |
It is indeed AuraDB! Yeah, am aware! But I'm getting the same set of errors even with bolt connections. Not sure how this should be overcome. |
What neo4rs version are you using? |
0.7.2! |
I could reproduce the issue and I believe I have a fix in #183. I also backported this to the 0.7 branch and will do a 0.7.3 shortly. If you want to test it out before that you can use [dependencies]
neo4rs = { git = "https://github.com/neo4j-labs/neo4rs.git", branch = "0.7" } Note that server side routing on Aura is only enabled for database version 5; databases with version 4 expect clients to do all routing and will continue to not work with this client for some time. |
You're awesome @knutwalker! Do I have to add anything new in the existing initialisation of an instance? Seems like I'm still getting the same issue.
|
No, there should not not be a change in usage. My testing against an AuraDB 5 instance seemed to have fixed it 🤔 |
0.7.3 added an empty routing table, indicating servers to use server-side routing and 0.8.0 added an automatic retry on certain errors (including NotALeader). The retry only works for The server still needs to have SSR enabled (which requires AuraDB 5, it's not enabled for AuraDB 4) and one can still overload the server and have it fail often enough for the retries to give up, in which case only a recude in load would help. We still need to implement client-side routing at some point. |
@knutwalker Mind leading the way with a few links to Neo4J docs where we can correctly understand how CSR works? |
@nixxholas There is https://neo4j.com/docs/operations-manual/current/clustering/setup/routing/#clustering-client-side-routing and https://neo4j.com/docs/bolt/current/driver-api/#client-side-routing and https://neo4j.com/docs/bolt/current/bolt/message/#messages-route The ROUTE message requires Bolt protocol 4.3 and there is a bigger refactor in progress before we can move to newer protocol versions (and would also have to support all other changes that are required by this) |
Greetings guys, facing this errors and tried alternatives around this. The only way is to use the neo4j crate by another developer (But it does not have the bells and whistles we have here).
Error: unexpected response for RUN: Failure(Failure { metadata: BoltMap { value: {BoltString { value: "message" }: String(BoltString { value: "No write operations are allowed directly on this database. Writes must pass through the leader. The role of this server is: FOLLOWER" }), BoltString { value: "code" }: String(BoltString { value: "Neo.ClientError.Cluster.NotALeader" })} } })
Anyway we can workaround this? Using Neo4J Aura, seems like routing is already dealt with on the server side.
The text was updated successfully, but these errors were encountered: