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

primary changed twice when pdms rolling update #7995

Closed
Lily2025 opened this issue Mar 28, 2024 · 2 comments · Fixed by #8157
Closed

primary changed twice when pdms rolling update #7995

Lily2025 opened this issue Mar 28, 2024 · 2 comments · Fixed by #8157
Assignees
Labels
severity/minor type/bug The issue is confirmed as a bug.

Comments

@Lily2025
Copy link

Bug Report

What did you do?

1、update the config of tso

What did you expect to see?

the primary changed once when tso rolling update

What did you see instead?

the primary changed twice when tso rolling update

What version of PD are you using (pd-server -V)?

./pd-server -V
Release Version: v8.0.0-alpha
Edition: Community
Git Commit Hash: bc92c13
Git Branch: heads/refs/tags/v8.0.0-alpha
UTC Build Time: 2024-03-27 11:37:04
2024-03-28T15:26:29.929+0800

@Lily2025 Lily2025 added the type/bug The issue is confirmed as a bug. label Mar 28, 2024
@Lily2025
Copy link
Author

/type bug
/severity major
/assign HuSharp

@HuSharp
Copy link
Member

HuSharp commented Jun 25, 2024

For tiup

  1. When we have 3 pdms, pdms-0/pdms-1/pdms-2, and pdms-2 is primary
  2. upgrade pdms-2 firstly maybe transfer primary to pdms-0
  3. uprade pdms-0 will transfer primary again

We can upgrade pdms primary in last place(named defer feature) can avoid unnecessary primary transfer

Ref pingcap/tiup#2414

For operator

tidb-operator does not have the ability to defer feature, it can only upgrade the pods in order.

Furthermore, Thinking about this situation:

  1. When we have 3 pdms, pdms-0/pdms-1/pdms-2, and pdms-2 is primary
  2. upgrade pdms-2 firstly maybe transfer primary to pdms-1
  3. upgrade pdms-1 maybe transfer primary to pdms-0.

To fix it, Assume that current primary ordinal is x, and range is [0, n]

  1. Find the max suitable ordinal in (x, n], because they have been upgraded
  2. If no suitable ordinal, find the min suitable ordinal in [0, x) to reduce the count of transfer

Ref pingcap/tidb-operator#5643

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor type/bug The issue is confirmed as a bug.
Projects
Development

Successfully merging a pull request may close this issue.

3 participants