Implement ConfigReload on full config SET update#651
Conversation
Signed-off-by: donggyu-nexthop <donggyu@nexthop.ai>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Donggyu Kim <donggyu@nexthop.ai>
1df4de5 to
d2317d3
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Donggyu Kim <donggyu@nexthop.ai>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Donggyu Kim <donggyu@nexthop.ai>
1bf8cdc to
e54c500
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@donggyu-nexthop can you use @sneelam20 perhaps a good example of why the @gnmi-dev alias would be good to have auto-added to this, or alternatively, some form of auto-assigning based on |
|
@ganglyu @abdosi @jipanyang @ndas7 could you give this a look? thank you! |
|
@sneelam20 @hdwhdw can we get some reviewers assigned to look at this? I do not have permissions to add reviewers. This PR was discussed in the 5/14 UMF meeting. sonic-gnmi used to support a whole-file config replace option, which was invoked by passing the filename to the rpc as an UPDATE. The original implementation relied on an early version of GnoiReboot which did a 'config reload' rather than a hard reboot. This feature broke when an actual GnoiReboot impl was added. This PR plumbs the feature correctly, using DBUS to call 'config reload' directly. This is not the same usage as the save-on-set feature, which triggers 'config save' after every write to make config changes persistent. This approach is intended for whole-config operations instead, where the user wants to bulk-load a config throw away anything pre-existing, then reload the system so that configuration takes effect. |
Why I did it
Resolves sonic-net/sonic-buildimage#22362
The current "full config update" operation over gNMI silently fails.
This is because the operation relied on GNOI System Reboot to pick up the requested configuration and apply it; however, the proper reboot call implementation ripped out the configuration file handling to better align with the GNOI system specs. This left the
config reloadoperation non-functional.How I did it
client.MixedDbClienthas a new field which can optionally store "post-response callbacks", which are just functions that will be invoked after the gRPC response has been issued back to the client.During
SetFullConfig, this field will be set to a callback that invokesDBusClient::ConfigReload(). Then, at the gNMI server layer, the server will invokeMixedDbClient::RunCallback()to execute the callback (if registered).The reason this step had to be deferred until the very end of the request lifecycle was because the
ConfigReloadD-Bus endpoint will restart ALL services, including the gNMI server, which means that calling this function directly from withinSetFullConfigleaves the gNMI client hanging with no response.How to verify it
gnmicto issue SET commands over gnmiWhich release branch to backport (provide reason below if selected)
Description for the changelog
Implement gNMI config reload without relying on gNOI reboots
Link to config_db schema for YANG module changes
N/A for this PR
A picture of a cute animal (not mandatory but encouraged)