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

API response of api/status to a follower node in raft mode returns RaftHealthyMembers field of null #1433

Open
geek981108 opened this issue Mar 17, 2022 · 0 comments · May be fixed by #1434

Comments

@geek981108
Copy link

geek981108 commented Mar 17, 2022

Background

Topology

Raft mode with:

  • 192.168.7.50: Follower
  • 192.168.7.51: Follower
  • 192.168.7.52: Leader

Request API

api/status

Response Example

Followers:

{
	"Code": "OK",
	"Message": "Application node is healthy",
	"Details": {
		"Healthy": true,
		"Hostname": "ecs-22dfc66mki113jo2941m",
		"Token": "76987b1fdac8522b2867b0637b30f64e437d30a42866d3a21ce9920a6772ba60",
		"IsActiveNode": false,
		"ActiveNode": {
			"Hostname": "192.168.7.52:10008",
			"Token": "",
			"AppVersion": "",
			"FirstSeenActive": "",
			"LastSeenActive": "",
			"ExtraInfo": "",
			"Command": "",
			"DBBackend": "",
			"LastReported": "0001-01-01T00:00:00Z"
		},
		"Error": null,
		"AvailableNodes": [{
			"Hostname": "ecs-22dfc66mki113jo2941m",
			"Token": "76987b1fdac8522b2867b0637b30f64e437d30a42866d3a21ce9920a6772ba60",
			"AppVersion": "3.2.6",
			"FirstSeenActive": "2022-03-17T09:35:29Z",
			"LastSeenActive": "2022-03-17T12:27:50Z",
			"ExtraInfo": "",
			"Command": "",
			"DBBackend": "/usr/local/orchestrator/orchestrator.sqlite3",
			"LastReported": "0001-01-01T00:00:00Z"
		}],
		"RaftLeader": "192.168.7.52:10008",
		"IsRaftLeader": false,
		"RaftLeaderURI": "http://192.168.7.52:3000",
		"RaftAdvertise": "192.168.7.51",
		"RaftHealthyMembers": null
	}
}

Leader:

{
	"Code": "OK",
	"Message": "Application node is healthy",
	"Details": {
		"Healthy": true,
		"Hostname": "ecs-4rn1v6e2772s1rry7guq",
		"Token": "1ccf60cf5a82b4c24a55fdcf28926ebb12fde4cbf17cbb3c88efd616e85e7069",
		"IsActiveNode": true,
		"ActiveNode": {
			"Hostname": "192.168.7.52:10008",
			"Token": "",
			"AppVersion": "",
			"FirstSeenActive": "",
			"LastSeenActive": "",
			"ExtraInfo": "",
			"Command": "",
			"DBBackend": "",
			"LastReported": "0001-01-01T00:00:00Z"
		},
		"Error": null,
		"AvailableNodes": [{
			"Hostname": "ecs-4rn1v6e2772s1rry7guq",
			"Token": "1ccf60cf5a82b4c24a55fdcf28926ebb12fde4cbf17cbb3c88efd616e85e7069",
			"AppVersion": "3.2.6",
			"FirstSeenActive": "2022-03-17T09:35:29Z",
			"LastSeenActive": "2022-03-17T12:30:26Z",
			"ExtraInfo": "",
			"Command": "",
			"DBBackend": "/usr/local/orchestrator/orchestrator.sqlite3",
			"LastReported": "0001-01-01T00:00:00Z"
		}],
		"RaftLeader": "192.168.7.52:10008",
		"IsRaftLeader": true,
		"RaftLeaderURI": "http://192.168.7.52:3000",
		"RaftAdvertise": "192.168.7.52",
		"RaftHealthyMembers": ["192.168.7.52", "192.168.7.51", "192.168.7.50"]
	}
}

Problems

When an API of status check called for followers, it gaves field RaftHealthyMembers null which is confused.

Expect

When an API of status check called for followers, it gaves field RaftHealthyMembers same result of leader node.

Solution

Make a replication of request to leader node when status check API called and get RaftHealthyMembers from it to replace follower one.

@geek981108 geek981108 linked a pull request Mar 18, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant