Comments (5)
When you say "change the leader" you mean the cluster elects a new leader, right? I just want to be sure.
If I understand this issue, it's basically the same as wanting redirects, right? If we had that, this wouldn't be an issue, correct?
from rqlite.
The cluster now has basic leader redirection, though I have not performed extensive testing. I just checked that curl -L ....
is redirected to the leader node. Let me know how it goes.
from rqlite.
When you say "change the leader" you mean the cluster elects a new leader, right? I just want to be sure.
Yep that's correct.
I just did some testing and it looks like things are okay! I set up the 3 node example, took down node.1(the first leader). And the outputs look good.
Node 3 was arbitarily chosen as the new leader when I did this:
curl localhost:4002/raft?pretty
{
"leader": "1d4e168",
"name": "7d2502e",
"peers": {
"1b2bcd5": {
"name": "1b2bcd5",
"connectionString": "http://localhost:4001"
},
"1d4e168": {
"name": "1d4e168",
"connectionString": "http://localhost:4003"
}
},
"state": "follower"
}
curl localhost:4003/raft?pretty
{
"leader": "1d4e168",
"name": "1d4e168",
"peers": {
"1b2bcd5": {
"name": "1b2bcd5",
"connectionString": "http://localhost:4001"
},
"7d2502e": {
"name": "7d2502e",
"connectionString": "http://localhost:4002"
}
},
"state": "leader"
One minor issue though, it doesn't look like the -L
parameter works with the raft endpoint. Node 3 is the leader in my case, but the raft endpoint for node 2 still shows node 2's data.
curl -L localhost:4002/raft?pretty
{
"leader": "1d4e168",
"name": "7d2502e",
"peers": {
"1b2bcd5": {
"name": "1b2bcd5",
"connectionString": "http://localhost:4001"
},
"1d4e168": {
"name": "1d4e168",
"connectionString": "http://localhost:4003"
}
},
"state": "follower"
IMO, this doesn't really matter because the same node's raft endpoint tells you enough data anyway.
Looking back over my first post in this thread, I'm seeing that I made an error and that rqlite is actually doing the leader reselection perfectly.
You can close this out if you like. Remember to add the -L page to your Readme. Thanks a ton man, this stuff is pretty exciting for me.
from rqlite.
Let me look into the issue you mentioned above, but that is a good idea about adding -L
to the README.
from rqlite.
Ok, yeah, I only put leader redirection in place for the write endpoint. If you want stats, diags, etc, you need to go out and hit each node individually. Let me know if this is an issue.
from rqlite.
Related Issues (20)
- Auto-restore occurring even with existing data HOT 19
- Don't automatically backup to Cloud on startup HOT 4
- Getting database disk image is malformed after rqlite interruption HOT 36
- Use Raft index to determine if database needs auto-backup HOT 11
- Support automatic VACUUM in rqlite HOT 7
- Execute Full Snapshot if database file is newer than last snapshot
- WAL snapshotting sometimes fails HOT 67
- rqlite may experience duplicate data insertion in case of network packet loss HOT 14
- Expose cluster client retry and timeout options to rqlite clients HOT 3
- [Feature Request] use server side Postgres Protocol HOT 4
- Build WAL "compact list" as writes occur -- and reduce Snapshotting time HOT 13
- rqlite /status can be slow to respond with rqlite is under load HOT 4
- Single-node cluster rejects unified endpoint with freshness "err stale read" HOT 6
- aws: migrate code to Go SDK v2
- Support queries automatically timing out after X seconds HOT 11
- datetime string parsing difference between rqlite HOT 8
- Under load rqlite can take seconds to close a read-only file HOT 2
- Exponential wait time increase if Raft Snapshot fails HOT 6
- readyz/freshness do not consider raft index HOT 93
- Snapshot transfer performance HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rqlite.