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

Add SaveOnSet #108

Merged
merged 29 commits into from
May 21, 2024
Merged

Add SaveOnSet #108

merged 29 commits into from
May 21, 2024

Conversation

rlucus
Copy link
Contributor

@rlucus rlucus commented May 9, 2023

Why I did it

Enable save-on-set for gnmi. Creates a configDB backup to disk after eat gnmi.Set if enabled.

How I did it

Add a function pointer that allows the entire feature to be enabled by command line argument. If enabled, a call to sonic-services-client sends a message on the DBUS to the sonic host service modules.

HLD here
sonic-net/SONiC#1239

sonic-buildimage PR here
sonic-net/sonic-buildimage#18481

gnmi_server/server.go Outdated Show resolved Hide resolved
gnmi_server/server.go Outdated Show resolved Hide resolved
gnmi_server/server.go Outdated Show resolved Hide resolved
@rlucus
Copy link
Contributor Author

rlucus commented May 15, 2024

Sorry wrong link to HLD. it is here sonic-net/SONiC#1297

@@ -503,6 +530,7 @@ func (s *Server) Set(ctx context.Context, req *gnmipb.SetRequest) (*gnmipb.SetRe
common_utils.IncCounter(common_utils.GNMI_SET_FAIL)
}

s.SaveStartupConfig()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No locks in both Set() and SaveOnSetEnabled(). Is it safe to allow parallel db writes and config saves?

Copy link

linux-foundation-easycla bot commented May 17, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@sneelam20 sneelam20 merged commit 585f441 into sonic-net:master May 21, 2024
5 checks passed
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 this pull request may close these issues.

6 participants