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

Fallback to use the PD leader member info if it does not exist in etcd member list #7752

Closed
JmPotato opened this issue Jan 24, 2024 · 1 comment · Fixed by #7753
Closed
Labels
component/client Client logic. type/enhancement The issue or PR belongs to an enhancement.

Comments

@JmPotato
Copy link
Member

From PD A:

[2024/01/21 01:51:07.255 +08:00] [INFO] [server.go:1434] ["start to watch pd leader"] [pd-leader="name:\"pd-{pd_b}-2379\" member_id:10281341235671451865 peer_urls:\"http://{pd_b}:2380\" client_urls:\"http://{pd_b}:2379\" "]

According to this log, it successfully watch and set the PD leader B at 01:51:07.255. However, from the client side:

[2024/01/21 01:51:47.495 +08:00] [INFO] [base_client.go:299] ["[pd] cannot update member from this address"] [address=http://{pd_a}:2379] [error="[PD:client:ErrClientGetLeader]get leader from leader address don't exist error"]

This means the following code failed to get the pdLeader from members though it has a PD leader set.

pd/server/grpc_service.go

Lines 495 to 501 in b27b1e9

leader := s.member.GetLeader()
for _, m := range members {
if m.MemberId == leader.GetMemberId() {
pdLeader = m
break
}
}

Maybe we should fallback to use the PD leader member info if it does not exist in etcd member list.

@JmPotato JmPotato added type/enhancement The issue or PR belongs to an enhancement. component/client Client logic. labels Jan 24, 2024
ti-chi-bot bot added a commit that referenced this issue Jan 24, 2024
…members (#7753)

close #7752

Use the PD leader member set in the server if it's not in the etcd member list to gain a better chance to work.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
@JmPotato
Copy link
Member Author

The significant time difference between the two logs is because the physical time of the machine differs by 40 seconds. So this should not be a problem that needs to be fixed.

@JmPotato JmPotato closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2024
ti-chi-bot bot pushed a commit that referenced this issue Jan 25, 2024
#7753)" (#7755)

ref #7752

This reverts commit d3b9307 from #7753.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/client Client logic. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant