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

Updating config is not atomic #7464

Open
rleungx opened this issue Nov 28, 2023 · 0 comments
Open

Updating config is not atomic #7464

rleungx opened this issue Nov 28, 2023 · 0 comments

Comments

@rleungx
Copy link
Member

rleungx commented Nov 28, 2023

Bug Report

cfg := m.srv.GetPersistOptions().GetPDServerConfig().Clone()
cfg.DashboardAddress = m.members[minMemberIdx].GetClientUrls()[0]
if err := m.srv.SetPDServerConfig(*cfg); err != nil {
log.Warn("failed to set persist options")
}

Consider that we update the config using API at the same time, the timeline could be:

  1. The dashboard first gets config and clone it
  2. API finish updating config
  3. The dashboard updates its config in the last

Step 2's updates could be overridden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Need Triage
Development

No branches or pull requests

3 participants