Closed nkorange closed 1 year ago
Please report it to nacos project.
If you think the issue is in jraft, please provide a simple election example to reproduce the issue.
Note: looks like there are three raft groups in the log:
Every group has different leaders, it's expected.
@killme2008 Hi, the problem is for a particular group, there are different leaders.
For example, the group naming_persistent_service_v2 has two leaders.
@killme2008 Hi, the problem is for a particular group, there are different leaders.
For example, the group naming_persistent_service_v2 has two leaders.
It's ok because the term is different. When the lower-term leader tries to replicate logs to other followers, the followers will reject.
@killme2008 Hi, the problem is for a particular group, there are different leaders. For example, the group naming_persistent_service_v2 has two leaders.
It's ok because the term is different. When the lower-term leader tries to replicate logs to other followers, the followers will reject.
These are the last parts of the logs. Should they come to the same term eventually?
@killme2008 Hi, the problem is for a particular group, there are different leaders. For example, the group naming_persistent_service_v2 has two leaders.
It's ok because the term is different. When the lower-term leader tries to replicate logs to other followers, the followers will reject.
These are the last parts of the logs. Should they come to the same term eventually?
Of course. If the lower-term leader found there is a high-term leader already existing, it will step down. And the new leader will try to replicate logs to it and cast it to a follower.
FYI: These logs are printed by nacos, not jraft. The jraft log may be in a different log file. You can find more detail logs in it.
@killme2008 Hi I found some JRaft logs on nacos1 at 16:06:57,288 when nacos1 changed its leader to nacos2:
Did it mean something?
The cause is the data directory is removed at the restart of Nacos.
Describe the bug
I deployed 3 Nacos 2.1.2 servers, which uses JRaft 1.3.8. At first everything is good.
Then I restarted nacos0 and nacos1, and now there are two leaders: nacos1 and nacos2.
Expected behavior
There is only one leader.
Actual behavior
There are two leaders.
logs on nacos0:
logs on nacos1:
logs on nacos2:
Steps to reproduce
Minimal yet complete reproducer code (or GitHub URL to code)
Environment
java -version
): 1.8uname -a
): AliCloud Linux