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

[write standby] force DB connections to use unix socket to connect #14524

Merged
merged 2 commits into from
Apr 6, 2023

Conversation

yxieca
Copy link
Contributor

@yxieca yxieca commented Apr 4, 2023

Why I did it

At service start up time, there are chances that the networking service is being restarted by interface-config service. When that happens, write_standby could fail to make DB connections due to loopback interface is being reconfigured.

How I did it

Force the db connector to use unix socket to avoid loopback reconfig timing window.

How to verify it

Run config reload test 20+ times and no issue encountered.

At service start up time, there are chances that the networking service is being
restarted by interface-config service. When that happens, write_standby could
fail to make DB connections due to loopback interface is being reconfigured.

Since the reconfiguration is transient, add a few retries to the DB connections
so that the script won't fail unnecessarily

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@yxieca yxieca changed the title [write standby] retry DB connections [write standby] force DB connections to use unix socket to connect Apr 5, 2023
@yxieca yxieca merged commit 737d0e5 into sonic-net:master Apr 6, 2023
@yxieca yxieca deleted the service branch April 6, 2023 20:55
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Apr 6, 2023
…onic-net#14524)

Why I did it
At service start up time, there are chances that the networking service is being restarted by interface-config service. When that happens, write_standby could fail to make DB connections due to loopback interface is being reconfigured.

How I did it
Force the db connector to use unix socket to avoid loopback reconfig timing window.

How to verify it
Run config reload test 20+ times and no issue encountered.
Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* use unix socket instead

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202205: #14553

@liushilongbuaa
Copy link
Contributor

2002205 kvmtest failed.

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Apr 20, 2023
…onic-net#14524)

Why I did it
At service start up time, there are chances that the networking service is being restarted by interface-config service. When that happens, write_standby could fail to make DB connections due to loopback interface is being reconfigured.

How I did it
Force the db connector to use unix socket to avoid loopback reconfig timing window.

How to verify it
Run config reload test 20+ times and no issue encountered.
Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* use unix socket instead

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202211: #14773

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants